-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drop and create tables with fixtures on cakephp #5693
Comments
@AlessandroMinoccheri in both cases you only tried importing from your database an not using the fixture records. Get rid of the import line or keep that and get rid of the rest (but if using import and no records in your database, then no records for tests). |
@jadb I have removed the line
same problem: test drops tables and doesn't create it |
@AlessandroMinoccheri - can you try an actual test? It could be that the fixture is not being triggered to create the tables yet. Also, how do you know it's dropping any tables? Are you testing on your default database or test database? |
I'm testing on test database, I see from phpmyadmin that the table posts is dropped but not regenerated, if I launch test return me error because the tables couldn't be found |
Have you checked logs for errors? Are you on IRC? |
No I'm not on IRC and I don't have check in error logs, I'll check it! |
Seems that there aren't errors |
There is an error in error.logs but I don't know if is the problem:
|
I get the following error when I run your test/fixture with the
You have a typo in your fixture data. |
I have fixed the typo but same error, It can't recreate tables |
So could you please reopen the issue? |
@AlessandroMinoccheri you aren't demonstrating a problem with the framework, and are drawing false conclusions.
Fixtures are dropped at the end of a test - The only way you'll see them lying around after running a test is if the test case fails to complete (e.g. triggers a fatal error during a test). If you have a test case that is failing because fixture data is not being loaded - by all means please demonstrate that. But bear in mind the core test suite uses fixtures (extensively) and the tests work. In future please keep support requests to an appropriate place =). |
I would like to create test where I'm loading fixtures so test drop tables and create it with records.
My problem is that: Tests drop tables but it doesn't recreate it.
This is my model where I'm loading fixtures:
And this is my fixture file:
I have also tried with:
Same thing tests drop tables but doesn't create it.
I need to create it after drop with my records.
Where s the error? Why tests doesn't recreate it table posts but only drop it?
Thanks
The text was updated successfully, but these errors were encountered: