remove unnecessary variable
This commit is contained in:
parent
ca7d6296e8
commit
a02562d9b0
|
@ -15,18 +15,18 @@ class ComicPressSidebarStandard extends ComicPressView {
|
||||||
function _all_comic_dates_ok() {
|
function _all_comic_dates_ok() {
|
||||||
global $comicpress_manager;
|
global $comicpress_manager;
|
||||||
|
|
||||||
$this->all_comic_dates_ok = true;
|
$all_comic_dates_ok = true;
|
||||||
$this->all_comic_dates = array();
|
$all_comic_dates = array();
|
||||||
|
|
||||||
foreach ($comicpress_manager->comic_files as $comic_file) {
|
foreach ($comicpress_manager->comic_files as $comic_file) {
|
||||||
if (($result = $comicpress_manager->breakdown_comic_filename(pathinfo($comic_file, PATHINFO_BASENAME))) !== false) {
|
if (($result = $comicpress_manager->breakdown_comic_filename(pathinfo($comic_file, PATHINFO_BASENAME))) !== false) {
|
||||||
if (isset($this->all_comic_dates[$result['date']])) { $this->all_comic_dates_ok = false; break; }
|
if (isset($all_comic_dates[$result['date']])) { $all_comic_dates_ok = false; break; }
|
||||||
$this->all_comic_dates[$result['date']] = true;
|
$all_comic_dates[$result['date']] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->too_many_comics_message = "";
|
$this->too_many_comics_message = "";
|
||||||
if ($this->all_comic_dates_ok) {
|
if (!$all_comic_dates_ok) {
|
||||||
$this->too_many_comics_message = ", <em>" . __("multiple files on the same date!", 'comicpress-manager') . "</em>";
|
$this->too_many_comics_message = ", <em>" . __("multiple files on the same date!", 'comicpress-manager') . "</em>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ class ComicPressSidebarStandardTest extends PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
$v = new ComicPressSidebarStandard();
|
$v = new ComicPressSidebarStandard();
|
||||||
$v->_all_comic_dates_ok();
|
$v->_all_comic_dates_ok();
|
||||||
$this->assertTrue($v->all_comic_dates_ok);
|
$this->assertTrue(empty($v->too_many_comics_message));
|
||||||
|
|
||||||
// one comic
|
// one comic
|
||||||
$comicpress_manager = $this->getMock('ComicPressManager', array('breakdown_comic_filename'));
|
$comicpress_manager = $this->getMock('ComicPressManager', array('breakdown_comic_filename'));
|
||||||
|
@ -24,7 +24,7 @@ class ComicPressSidebarStandardTest extends PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
$v = new ComicPressSidebarStandard();
|
$v = new ComicPressSidebarStandard();
|
||||||
$v->_all_comic_dates_ok();
|
$v->_all_comic_dates_ok();
|
||||||
$this->assertTrue($v->all_comic_dates_ok);
|
$this->assertTrue(empty($v->too_many_comics_message));
|
||||||
|
|
||||||
// two comics
|
// two comics
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class ComicPressSidebarStandardTest extends PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
$v = new ComicPressSidebarStandard();
|
$v = new ComicPressSidebarStandard();
|
||||||
$v->_all_comic_dates_ok();
|
$v->_all_comic_dates_ok();
|
||||||
$this->assertFalse($v->all_comic_dates_ok);
|
$this->assertTrue(!empty($v->too_many_comics_message));
|
||||||
}
|
}
|
||||||
|
|
||||||
function providerTestThumbnailGenerationInfo() {
|
function providerTestThumbnailGenerationInfo() {
|
||||||
|
@ -112,6 +112,12 @@ class ComicPressSidebarStandardTest extends PHPUnit_Framework_TestCase {
|
||||||
$this->assertTrue(!empty($result));
|
$this->assertTrue(!empty($result));
|
||||||
$this->assertEquals($info['result'], $result);
|
$this->assertEquals($info['result'], $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testRender() {
|
||||||
|
global $comicpress_manager;
|
||||||
|
|
||||||
|
//
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue