I worry that this question is a little specific for this forum, but I'm desperate, so here goes...
I have a problem with a CakePHP unit test retrieving REAL data, where I need
to use fixture data. I'll explain by way of example.
- Model Widgets has a method abc().
- Widget->abc() retrieves data from its own model, but also queries data from another model, Shapes. The 2 models are NOT joined by any table relationships. The Shapes model is invoked by calling App::import('Model','Shapes').
- Fixtures exist for both the Widget and Shape models. Both fixtures are included at the top of the Widget test case class.
- When I run unit tests on Widget->abc(), it dutifully retrieves data from the test_suite_widgets table created by the fixture. However, when Widget->abc() retrieves data from the Shapes model, that data comes from the LIVE database. I know this because I can see all of the SQL queries being executed.
I hope this all makes sense. Any ideas?





Bookmarks