test for get attachments
This commit is contained in:
parent
843d3eb34c
commit
08aaf6eb69
|
@ -158,6 +158,21 @@ class ComicPressComicPostTest extends PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
$this->assertEquals($expected_result, $this->p->find_parents());
|
$this->assertEquals($expected_result, $this->p->find_parents());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testGetAttachments() {
|
||||||
|
$backend = $this->getMock('ComicPressFakeBackend', array('generate_from_post'));
|
||||||
|
|
||||||
|
$post = (object)array('ID' => 1);
|
||||||
|
|
||||||
|
$backend->expects($this->once())->method('generate_from_post')->with($post)->will($this->returnValue(array('test')));
|
||||||
|
|
||||||
|
$comicpress = ComicPress::get_instance();
|
||||||
|
$comicpress->backends = array($backend);
|
||||||
|
|
||||||
|
$this->p->post = $post;
|
||||||
|
|
||||||
|
$this->assertEquals(array('test'), $this->p->get_attachments());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue