From 1c298f4105528dbdf6e04dd9b23d03b56ac39b60 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Mon, 23 Nov 2009 08:20:52 -0500 Subject: [PATCH] create options --- classes/PostFixtures.inc | 1 + test/PostFixturesTest.php | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/classes/PostFixtures.inc b/classes/PostFixtures.inc index 75172fc..ed4cdfa 100644 --- a/classes/PostFixtures.inc +++ b/classes/PostFixtures.inc @@ -188,6 +188,7 @@ class PostFixtures { function create($data) { $categories_by_slug = $this->create_categories($data['categories']); $this->create_posts($data['posts'], $categories_by_slug); + $this->process_blog_options($data['options'], $categories_by_slug); } function remove() { diff --git a/test/PostFixturesTest.php b/test/PostFixturesTest.php index c3afd1a..c07c061 100644 --- a/test/PostFixturesTest.php +++ b/test/PostFixturesTest.php @@ -220,11 +220,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 = $this->getMock('PostFixtures', array('create_posts', 'create_categories', 'process_blog_options')); + $pf->expects($this->once())->method('create_posts')->with('posts', 'processed'); + $pf->expects($this->once())->method('create_categories')->with('categories')->will($this->returnValue('processed')); + $pf->expects($this->once())->method('process_blog_options')->with('options', 'processed'); - $pf->create(array('posts' => 'posts', 'categories' => 'categories')); + $pf->create(array('posts' => 'posts', 'categories' => 'categories', 'options' => 'options')); } function testRemove() {