multi-tables in zend test

3 messages Options
Embed this post
Permalink
huajun qi

multi-tables in zend test

Reply Threaded More More options
Print post
Permalink
I want to test my models, and some of them are related!

I wrote the dataseed xml file, but had no idea how to use it.

I initialize the data in one xml file, need I to return it in getDataSet method every model classes?

If I can initialize data once, where to use getDataSet method among many model calsses?

--
Location:
beberlei

Re: multi-tables in zend test

Reply Threaded More More options
Print post
Permalink
Hello Huajun,

the getDataSet() method is called once before each test and fills data for ALL
models, i.e. you have to add all the relevant to data to this file that you
need.

The PHPUnit documentation has an example how such an XML file might look like,
see Example 9.2

http://www.phpunit.de/manual/current/en/database.html

greetings,
Benjamin

On Monday 02 November 2009 08:19:19 am huajun qi wrote:
> I want to test my models, and some of them are related!
>
> I wrote the dataseed xml file, but had no idea how to use it.
>
> I initialize the data in one xml file, need I to return it in getDataSet
> method every model classes?
>
> If I can initialize data once, where to use getDataSet method among many
> model calsses?


--
Benjamin Eberlei
http://www.beberlei.de
huajun qi

Re: multi-tables in zend test

Reply Threaded More More options
Print post
Permalink
I have read the article, It mostly is about how to write data file, not how to use it.

So i am still confused by my question!

2009/11/2 Benjamin Eberlei <[hidden email]>
Hello Huajun,

the getDataSet() method is called once before each test and fills data for ALL
models, i.e. you have to add all the relevant to data to this file that you
need.

The PHPUnit documentation has an example how such an XML file might look like,
see Example 9.2

http://www.phpunit.de/manual/current/en/database.html

greetings,
Benjamin

On Monday 02 November 2009 08:19:19 am huajun qi wrote:
> I want to test my models, and some of them are related!
>
> I wrote the dataseed xml file, but had no idea how to use it.
>
> I initialize the data in one xml file, need I to return it in getDataSet
> method every model classes?
>
> If I can initialize data once, where to use getDataSet method among many
> model calsses?


--
Benjamin Eberlei
http://www.beberlei.de




--
Location: