code coverage

This commit is contained in:
John Bintz 2009-12-06 16:36:19 -05:00
parent ed222ef320
commit 93fa9500b7
2 changed files with 12 additions and 1 deletions

View File

@ -21,7 +21,10 @@ class ComicPressComicPost {
if (is_object($backend)) {
$a = $backend;
}
$attachments = array_merge($attachments, $a->generate_from_post($this->post));
$result = $a->generate_from_post($this->post);
if (is_array($result)) {
$attachments = array_merge($attachments, $result);
}
}
return $attachments;
}

View File

@ -232,6 +232,14 @@ class ComicPressComicPostTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($expected_result, $p->get_attachments_with_children());
}
function testGetAttachmentsStringProvided() {
$cp = ComicPress::get_instance(true);
$m = $this->getMock('TestFactory', array('generate_from_post'));
$cp->backends = array(get_class($m));
$this->p->get_attachments();
}
}
?>