Re: Iter of cakephp tests

2015-02-14 Thread Andrew Lechowicz
Fixture data is automatically loaded before each test run. Any data or 
structure in your existing test database will be deleted or dropped and 
replaced with only the relevant fixture data. From you linked Github issue 
it looks like you have some other issue with either you tests or code 
that's causing an error and the usual fixture drop/recreate/fill workflow 
is failing.

On Wednesday, January 21, 2015 at 4:20:31 PM UTC-5, Alessandro Minoccheri 
wrote:

 Hi all
 I'm writing hereu to understand well cakephp tests.

 I mean about this issue: 
 https://github.com/cakephp/cakephp/issues/5693#issuecomment-70532382

 So my question is:
 How to make good tests?
 Because in cakephp documentation isn't exaplained well I think or I 
 haven't understand well the correct iter.

 What I have always done:
 - 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?

 I would like to know the best practice to create a great workflow for tests

 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+unsubscr...@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.


Iter of cakephp tests

2015-01-22 Thread Alessandro Minoccheri
Hi all
I'm writing hereu to understand well cakephp tests.

I mean about this issue: 
https://github.com/cakephp/cakephp/issues/5693#issuecomment-70532382

So my question is:
How to make good tests?
Because in cakephp documentation isn't exaplained well I think or I haven't 
understand well the correct iter.

What I have always done:
- 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?

I would like to know the best practice to create a great workflow for tests

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+unsubscr...@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.