add post fixtures

This commit is contained in:
John Bintz 2010-01-14 19:35:43 -05:00
parent e0e830e399
commit ff497f14ad
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#!/usr/bin/env php
<?php
class GenerateFixtures {
function generate_flat_categories() {
$output = array('posts' => array());
for ($i = 0; $i < 100; ++$i) {
$output['posts'][] = array(
"post_date" => date('Y-m-d', $i * (60 * 60 * 24)),
"categories" => array("Category ${i}"),
"post_title" => "Post ${i}"
);
}
return json_encode($output);
}
}
foreach (get_class_methods('GenerateFixtures') as $method) {
echo "Generating ${method}...\n";
file_put_contents("${method}.json", call_user_func(array('GenerateFixtures', $method)));
}

File diff suppressed because one or more lines are too long