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) {
$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) {

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