code coverage

This commit is contained in:
John Bintz 2009-12-03 18:52:26 -05:00
parent 8ba8561ac5
commit f311986e5e
1 changed files with 15 additions and 0 deletions

View File

@ -99,6 +99,10 @@ class ComicPressMediaHandlingTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($expected_result, $cpmh->_expand_filter($filter, 'comic', (object)array('ID' => 1, 'post_date' => '2009-01-01 15:00:00'))); $this->assertEquals($expected_result, $cpmh->_expand_filter($filter, 'comic', (object)array('ID' => 1, 'post_date' => '2009-01-01 15:00:00')));
} }
function testExpandFilterNoPostDateRequested() {
$this->assertEquals('%date-Y%', $this->cpmh->_expand_filter('%date-Y%', 'comic', null));
}
function providerTestExpandFilterWPMUCallback() { function providerTestExpandFilterWPMUCallback() {
return array( return array(
array('', '', 'original'), array('', '', 'original'),
@ -181,10 +185,12 @@ class ComicPressMediaHandlingTest extends PHPUnit_Framework_TestCase {
return array( return array(
array('comic', array(), false), array('comic', array(), false),
array('comic', array('backend_url_comic' => '/test'), '/test'), array('comic', array('backend_url_comic' => '/test'), '/test'),
array('comic', array('backend_url_comic' => array('test')), false),
array('comic', array('backend_url_images' => 'test=/test'), false), array('comic', array('backend_url_images' => 'test=/test'), false),
array('comic', array('backend_url_images' => 'comic=/test'), '/test'), array('comic', array('backend_url_images' => 'comic=/test'), '/test'),
array('comic', array('backend_url_images' => array('comic' => '/test')), '/test'), array('comic', array('backend_url_images' => array('comic' => '/test')), '/test'),
array('comic', array('backend_url' => '/test'), '/test'), array('comic', array('backend_url' => '/test'), '/test'),
array('comic', array('backend_url' => array('test')), false),
); );
} }
@ -220,4 +226,13 @@ class ComicPressMediaHandlingTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($expected_result, $cpmh->_ensure_valid_uri($uri, 'comic')); $this->assertEquals($expected_result, $cpmh->_ensure_valid_uri($uri, 'comic'));
} }
function testEnsureValidURIInvalidType() {
_set_bloginfo('url', 'wordpress');
$cpmh = $this->getMock('ComicPressMediaHandling', array('_bundle_global_variables'));
$cpmh->expects($this->any())->method('_bundle_global_variables')->will($this->returnValue(array('comic' => 'comic-dir')));
$this->assertEquals('wordpress/', $cpmh->_ensure_valid_uri('%type-folder%', 'test'));
}
} }