diff --git a/classes/PostFixtures.inc b/classes/PostFixtures.inc index 9b5e14f..365f19b 100644 --- a/classes/PostFixtures.inc +++ b/classes/PostFixtures.inc @@ -77,4 +77,9 @@ class PostFixtures { $this->create_categories($data['categories']); $this->create_posts($data['posts'], $data['categories']); } + + function remove() { + $this->remove_all_posts(); + $this->remove_all_categories(); + } } diff --git a/test/PostFixturesTest.php b/test/PostFixturesTest.php index 2e7490c..b3eeb39 100644 --- a/test/PostFixturesTest.php +++ b/test/PostFixturesTest.php @@ -198,4 +198,13 @@ class PostFixturesTest extends PHPUnit_Framework_TestCase { $pf->create(array('posts' => 'posts', 'categories' => 'categories')); } + + function testRemove() { + $pf = $this->getMock('PostFixtures', array('remove_all_posts', 'remove_all_categories')); + + $pf->expects($this->once())->method('remove_all_posts'); + $pf->expects($this->once())->method('remove_all_categories'); + + $pf->remove(); + } }