test for get attachments

This commit is contained in:
John Bintz 2009-11-11 19:57:19 -05:00
parent 843d3eb34c
commit 08aaf6eb69
1 changed files with 62 additions and 47 deletions

View File

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