diff --git a/classes/PostFixtures.inc b/classes/PostFixtures.inc index dbd9f48..75172fc 100644 --- a/classes/PostFixtures.inc +++ b/classes/PostFixtures.inc @@ -113,8 +113,7 @@ class PostFixtures { } function process_data($data) { - $posts = array(); - $categories = array(); + $posts = $categories = $options = array(); foreach ($data as $type => $info) { switch ($type) { @@ -127,10 +126,13 @@ class PostFixtures { } } break; + case 'options': + $options = $info; + break; } } $categories = array_unique($categories); - return compact('posts', 'categories'); + return compact('posts', 'categories', 'options'); } function create_categories($categories) { diff --git a/test/PostFixturesTest.php b/test/PostFixturesTest.php index fbf78a9..c3afd1a 100644 --- a/test/PostFixturesTest.php +++ b/test/PostFixturesTest.php @@ -96,9 +96,24 @@ class PostFixturesTest extends PHPUnit_Framework_TestCase { ) ) ), - 'categories' => array('test1', 'test2') + 'categories' => array('test1', 'test2'), + 'options' => array() ) ), + array( + array( + 'options' => array( + 'test' => 'test2' + ) + ), + array( + 'posts' => array(), + 'categories' => array(), + 'options' => array( + 'test' => 'test2' + ) + ) + ) ); }