Thursday, January 22, 2015

cakephp tests best practice

Hi all,
I'm writing here to understand the right iter for cakephp tests.


So my question is:
How to make good tests?
Because in cakephp documentation isn't explained well I think or I haven0t understand the best practice to create tests.

What I have done in my cakephp site:
- Created default database
- Created test database
- Populated the default database
- Exported all database and imported into the tests database with all records
- Started to create test
- Created fixtures with declarations of fields and records
- Created tests model that load fixtures.

I thinked that when I'm starting to test when the framework load fixtures delete the table of the fixtures and redraw it with field and records.
Is wrong right?
Database table are dropped after tests I have read

Ok, so what is the good way to insert my records into database tests?
Repopulate the database tests from phpmyadmin for example? But in this way what is the purpose of the $records array in fixtures?

What is the right iter to create a great tests workflow?

Thanks


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: