options input

This commit is contained in:
John Bintz 2009-11-23 08:18:59 -05:00
parent 78b5325a0e
commit 7fce0343e1
2 changed files with 21 additions and 4 deletions

View File

@ -113,8 +113,7 @@ class PostFixtures {
} }
function process_data($data) { function process_data($data) {
$posts = array(); $posts = $categories = $options = array();
$categories = array();
foreach ($data as $type => $info) { foreach ($data as $type => $info) {
switch ($type) { switch ($type) {
@ -127,10 +126,13 @@ class PostFixtures {
} }
} }
break; break;
case 'options':
$options = $info;
break;
} }
} }
$categories = array_unique($categories); $categories = array_unique($categories);
return compact('posts', 'categories'); return compact('posts', 'categories', 'options');
} }
function create_categories($categories) { function create_categories($categories) {

View File

@ -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'
)
)
)
); );
} }