From 51dd891f34a68b7cf71c673cd1fd3c62b347ff8a Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 22 Nov 2009 19:05:20 -0500 Subject: [PATCH] create --- classes/PostFixtures.inc | 5 +++++ test/PostFixturesTest.php | 8 ++++++++ 2 files changed, 13 insertions(+) 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')); + } }