diff --git a/classes/PostFixtures.inc b/classes/PostFixtures.inc index 5c17aec..9b5e14f 100644 --- a/classes/PostFixtures.inc +++ b/classes/PostFixtures.inc @@ -72,4 +72,9 @@ class PostFixtures { } return $post_ids_created; } + + function create($data) { + $this->create_categories($data['categories']); + $this->create_posts($data['posts'], $data['categories']); + } } diff --git a/test/PostFixturesTest.php b/test/PostFixturesTest.php index 2cd1bf1..2e7490c 100644 --- a/test/PostFixturesTest.php +++ b/test/PostFixturesTest.php @@ -190,4 +190,12 @@ class PostFixturesTest extends PHPUnit_Framework_TestCase { } } } + + function testCreate() { + $pf = $this->getMock('PostFixtures', array('create_posts', 'create_categories')); + $pf->expects($this->once())->method('create_posts')->with('posts'); + $pf->expects($this->once())->method('create_categories')->with('categories'); + + $pf->create(array('posts' => 'posts', 'categories' => 'categories')); + } }