get filter
This commit is contained in:
parent
d9b46aa63e
commit
220322318d
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
|
||||
class ComicPressMediaHandling {
|
||||
var $default_filter = '%wordpress%/%type-folder%/%date-Y-m-d%*.*';
|
||||
|
||||
function _bundle_global_variables() {
|
||||
global $comic_folder, $archive_comic_folder, $rss_comic_folder, $mini_comic_folder;
|
||||
|
||||
|
@ -17,4 +19,22 @@ class ComicPressMediaHandling {
|
|||
}
|
||||
return $bundle;
|
||||
}
|
||||
|
||||
function _get_filter($filter_to_use = null) {
|
||||
global $comic_filename_filters;
|
||||
|
||||
if (!is_null($filter_to_use)) {
|
||||
if (is_string($filter_to_use)) {
|
||||
if (isset($comic_filename_filters[$filter_to_use])) {
|
||||
return $comic_filename_filters[$filter_to_use];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->default_filter;
|
||||
}
|
||||
|
||||
function get_comic_path($source = 'comic', $override_post = null, $filter = 'default', $multi = false) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,4 +26,24 @@ class ComicPressMediaHandlingTest extends PHPUnit_Framework_TestCase {
|
|||
'mini' => 'mini'
|
||||
), $this->cpmh->_bundle_global_variables());
|
||||
}
|
||||
|
||||
function providerTestGetFilter() {
|
||||
return array(
|
||||
array(null, '%wordpress%/%type-folder%/%date-Y-m-d%*.*'),
|
||||
array('fail', '%wordpress%/%type-folder%/%date-Y-m-d%*.*'),
|
||||
array(array(), '%wordpress%/%type-folder%/%date-Y-m-d%*.*'),
|
||||
array('test', 'test')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerTestGetFilter
|
||||
*/
|
||||
function testGetFilter($filter_to_use, $expected_result) {
|
||||
global $comic_filename_filters;
|
||||
|
||||
$comic_filename_filters['test'] = 'test';
|
||||
|
||||
$this->assertEquals($expected_result, $this->cpmh->_get_filter($filter_to_use));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,9 +10,6 @@ class GraphicalNavigationWidgetTest extends PHPUnit_Framework_TestCase {
|
|||
$this->w = new GraphicalNavigationWidget();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers WidgetComicPressGraphicalStorylineNavigation::update
|
||||
*/
|
||||
function testUpdateWidget() {
|
||||
$result = $this->w->update(array(
|
||||
"next" => "<b>test</b>",
|
||||
|
@ -41,7 +38,6 @@ class GraphicalNavigationWidgetTest extends PHPUnit_Framework_TestCase {
|
|||
|
||||
/**
|
||||
* @dataProvider providerTestIsNavLinkVisible
|
||||
* @covers WidgetComicPressGraphicalStorylineNavigation::_will_display_nav_link
|
||||
*/
|
||||
function testIsNavLinkVisible($which, $current_id, $target_id, $expected_result) {
|
||||
$current = (object)array('ID' => $current_id);
|
||||
|
@ -76,7 +72,6 @@ class GraphicalNavigationWidgetTest extends PHPUnit_Framework_TestCase {
|
|||
|
||||
/**
|
||||
* @dataProvider providerTestGroupNavigationButtons
|
||||
* @covers WidgetComicPressGraphicalStorylineNavigation::_group_navigation_buttons
|
||||
*/
|
||||
function testGroupNavigationButtons($buttons, $expected_grouping) {
|
||||
_set_filter_expectation('comicpress_navigation_grouping_details', array(array(
|
||||
|
|
Loading…
Reference in New Issue