Open sime opened 11 years ago
Are you using the migration plug-in?
https://github.com/CakeDC/migrations
I recommend its use.
cake Migrations.migration run all --connection test
Yes. Using it as an interim.
The interesting thing about fixtures is that it supports $records
. And it's quite easy to bake fixtures with $records
:
$ cake bake fixture --records --count 10 Model
OK, But, Why do you use fixture data? Dummy data made by bake will be not assertable. I think good that test data defines with table format in background section.
If you want use dummy data, my idea is followings:
// feature
Given Post has 10 article
// step
$steps->Given('/^Post has (\d+) article$/', function($world, $times) { $world->truncateModel('Post'); $post = $world->getModel('Post'); for ($i = 0; $i < $times; $i++) { $post->create(....); $post->save(); } });
I think I understand what you mean.
Are you referring to using to backgrounds in gherkin?
Would it be possible to load all fixtures prior to running story tests?
For example could
$hooks->beforeSuite()
runCakeFixtureManager::fixturize()
?Or is there another technique to populating the
$test
database. I'm finding it difficult to scale testing to multiple developers who constantly need to update the$test
database schema.