osdir.com
mailing list archive F.A.Q. -since 2001!



Subject: Fixture file is not being loaded during tests. -
msg#01313

List: CakePHP

Mail Archive Navigation:
by Date: Prev Next Date Index by Thread: Prev Next Thread Index

Hi guys, I'm trying to test a model. The first problem I faced was
having to load all fixtures from all the related models. The issue is
well known and, just to get up and running fast, I loaded all fixtures
in my startTest function, as I show bellow:

function startTest() {
$fixturesPath = APP . 'tests' . DS . 'fixtures';

$handle = opendir($fixturesPath);

while (false !== ($file = readdir($handle))) {
$fixtureFileName = 'app.' . substr($file, 0, strpos($file,
'_fixture'));

if ($fixtureFileName != 'app.') {
$this->fixtures[] = $fixtureFileName;
}
}

$this->Order = & ClassRegistry::init('Order');
}

I could make the test run. But then I noticed the OrderFixture file,
despite being in the fixture array, does not get loaded. I can even
write random stuff in the file and there no errors and the tests keep
passing.

Does anyone know how to fix it? I want to have control over the
records in the test database. The way it's today, the model is loading
live data in the tests!

Thanks in advance,

zehzinho

Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

Thread at a glance:

Previous Message by Date:

Re: How can I populate data belonging to TWO NON-RELATED TABLES in ONE Controller

thank you guys Ancy On Sun, Sep 26, 2010 at 7:42 PM, emmexx <emmeicsics@xxxxxxxxx> wrote: > > > On 26 Set, 15:22, Divya Banik <divya101...@xxxxxxxxx> wrote: >> Or you can use ClassRegistry::init('ServerInfo')->find('all'); > > For the record the manual lists the cake way to load a model: > > http://book.cakephp.org/view/67/Understanding-Models > http://book.cakephp.org/view/529/Using-App-import > > bye >   maxx > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx > To unsubscribe from this group, send email to > cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx To unsubscribe from this group, send email to cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Next Message by Date:

htaccess and domain

I set webroot to app/webroot Also I edited .htaccess file to redirect user to domain without www url, if a user access the site with www.mydomain, user is redirected to mydomain.com. Not sure which .htaccess file I edited but before I set webroot to app/ webroot, redirecting www.mydomain to mydomain was working fine but after I set webroot to app/webroot. It seems like, .htaccess is not working properly anymore. I realized that there are couple of .htaccess in cakephp dir. - cake dir/.htaccess - webroot/.htaccess - cake dir/app/.htaccess Which file I need to edit to set redirect? I edit all of three above files but none of it working. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx To unsubscribe from this group, send email to cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Previous Message by Thread:

shared controller functions

So I want to use some of the functions from my locations controller in my domains controller. I know how to load a model, which is working, but when I tried to load a controller, it didnt seem to work is there some special syntax for this? ~Michael Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.   You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx To unsubscribe from this group, send email to cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Next Message by Thread:

htaccess and domain

I set webroot to app/webroot Also I edited .htaccess file to redirect user to domain without www url, if a user access the site with www.mydomain, user is redirected to mydomain.com. Not sure which .htaccess file I edited but before I set webroot to app/ webroot, redirecting www.mydomain to mydomain was working fine but after I set webroot to app/webroot. It seems like, .htaccess is not working properly anymore. I realized that there are couple of .htaccess in cakephp dir. - cake dir/.htaccess - webroot/.htaccess - cake dir/app/.htaccess Which file I need to edit to set redirect? I edit all of three above files but none of it working. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx To unsubscribe from this group, send email to cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
blog comments powered by Disqus

Home | News | Sitemap | FAQ | advertise | OSDir is an Inevitable website. GBiz is too!