Re: Fixture not using Model useTable
I just solved it after a miserable 3 hours of trouble-shooting. SimpleTest seems to have a flaw. It has two different methods for determining the test_suite table name. During table creation and insertion of fixture records, it uses the test model name property. During subsequent interaction with the test suite table, it properly respects the useTable specification in the real model. It took a lot of fiddling to determine that. And, due to the pluralizations you just mentioned, I had to change the test model name to Dat. I may add a custom inflection tomorrow but I had trouble getting simpleTest to recognize custom inflections earlier. I'm glad that is all over with. Thanks for your help. 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 To unsubscribe, reply using "remove me" as the subject.
Re: Fixture not using Model useTable
Wild straw grabbing - is it to do with the pluralisation of the table name? data/datum/datums? Jeremy Burns jeremybu...@me.com On 10 Apr 2010, at 07:12, Josh wrote: > Thanks for your response. I have been clearing cache periodically and > my debug is set to 2. I believe that when running simpleTest, cake > flashes the cache automatically at debug = 2 but I have been clearing > it myself just to be sure. > > No luck still. > > Any other ideas? > > 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 > > To unsubscribe, reply using "remove me" as the subject. 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
Re: Fixture not using Model useTable
Thanks for your response. I have been clearing cache periodically and my debug is set to 2. I believe that when running simpleTest, cake flashes the cache automatically at debug = 2 but I have been clearing it myself just to be sure. No luck still. Any other ideas? 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 To unsubscribe, reply using "remove me" as the subject.
Re: Fixture not using Model useTable
Have you cleared your cache? Clear the contents of all folders under /app/tmp/cache. Then run your app with debug set to 2 at least once (this refills the cache). If you are using var $persistModel = true; in your app_controller, disable that first then re-enable. Jeremy Burns jeremybu...@me.com On 10 Apr 2010, at 06:46, Josh wrote: > Hello (help!!!), > > I had to rename a table in my database. I was able to specify the > useTable in my model so there was no significant knock-on from this > change. > > But, my unit tests won't recognize the new table name during table > creation. I can see in the SQL dump that the old table has been > created (per Inflector:pluralize), and from the error... > > "Database table test_suite_datums for model Datum was not found." > > ... I can see that simpleTest knows what the table name should be > (datums is the new useTable... replacing the default data--which > conflicts with Cake). I have tried emptying cache, writing a custom > inflection, and I have tried putting in undocumented members--ie > useTable--in the fixture. But, I can't seem to solve this problem, and > now none of my tests can run since this fixture is instantiated for > all test cases. > > Any suggestions? I have seen similar problems to this which were never > solved: > > http://groups.google.com/group/cake-php/browse_thread/thread/fedca8aff44d9a4f/9040989b8f883180?lnk=gst&q=fixture+usetable#9040989b8f883180 > > I am pulling my hair out. I'd prefer not rename the model entirely. > There must be a clean way to make the fixture recognize the Model > useTable. > > Thanks > > 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 > > To unsubscribe, reply using "remove me" as the subject. 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
Fixture not using Model useTable
Hello (help!!!), I had to rename a table in my database. I was able to specify the useTable in my model so there was no significant knock-on from this change. But, my unit tests won't recognize the new table name during table creation. I can see in the SQL dump that the old table has been created (per Inflector:pluralize), and from the error... "Database table test_suite_datums for model Datum was not found." ... I can see that simpleTest knows what the table name should be (datums is the new useTable... replacing the default data--which conflicts with Cake). I have tried emptying cache, writing a custom inflection, and I have tried putting in undocumented members--ie useTable--in the fixture. But, I can't seem to solve this problem, and now none of my tests can run since this fixture is instantiated for all test cases. Any suggestions? I have seen similar problems to this which were never solved: http://groups.google.com/group/cake-php/browse_thread/thread/fedca8aff44d9a4f/9040989b8f883180?lnk=gst&q=fixture+usetable#9040989b8f883180 I am pulling my hair out. I'd prefer not rename the model entirely. There must be a clean way to make the fixture recognize the Model useTable. Thanks 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 To unsubscribe, reply using "remove me" as the subject.