From 635ec15cabbaf710d0dc078c1e80ee27ec4b984f Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 22 Nov 2009 19:07:13 -0500 Subject: [PATCH] remove --- classes/PostFixtures.inc | 5 +++++ test/PostFixturesTest.php | 9 +++++++++ 2 files changed, 14 insertions(+) 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(); + } }