create
This commit is contained in:
parent
054dd5a229
commit
51dd891f34
@ -72,4 +72,9 @@ class PostFixtures {
|
||||
}
|
||||
return $post_ids_created;
|
||||
}
|
||||
|
||||
function create($data) {
|
||||
$this->create_categories($data['categories']);
|
||||
$this->create_posts($data['posts'], $data['categories']);
|
||||
}
|
||||
}
|
||||
|
@ -190,4 +190,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->create(array('posts' => 'posts', 'categories' => 'categories'));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user