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@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to