remove a bunch of tests and methods no longer needed

This commit is contained in:
John Bintz 2009-11-07 22:09:06 -05:00
parent 261fce60d5
commit 93f1e856b7
3 changed files with 4 additions and 92 deletions

View File

@ -428,14 +428,6 @@ class ComicPressStoryline {
return $this; return $this;
} }
function &include_children($parent = null) {
return $this->_include('_find_children', $parent);
}
function &exclude_children($parent = null) {
return $this->_exclude('_find_children', $parent);
}
function _find_level_or_above($level = null) { function _find_level_or_above($level = null) {
$found = array(); $found = array();
foreach ($this->_structure as $category_id => $info) { foreach ($this->_structure as $category_id => $info) {
@ -444,14 +436,6 @@ class ComicPressStoryline {
return $found; return $found;
} }
function &include_level_or_above($level = null) {
return $this->_include('_find_level_or_above', $level);
}
function &exclude_level_or_above($level = null) {
return $this->_exclude('_find_level_or_above', $level);
}
function _find_only($id = null) { function _find_only($id = null) {
if (isset($this->_structure[$id])) { if (isset($this->_structure[$id])) {
return array($id); return array($id);
@ -459,14 +443,6 @@ class ComicPressStoryline {
return array(); return array();
} }
function &include_only($id = null) {
return $this->_include('_find_only', $id);
}
function &exclude_only($id = null) {
return $this->_exclude('_find_only', $id);
}
function _find_level($level = null) { function _find_level($level = null) {
$found = array(); $found = array();
foreach ($this->_structure as $category_id => $info) { foreach ($this->_structure as $category_id => $info) {
@ -475,14 +451,6 @@ class ComicPressStoryline {
return $found; return $found;
} }
function &include_level($id = null) {
return $this->_include('_find_level', $id);
}
function &exclude_level($id = null) {
return $this->_exclude('_find_level', $id);
}
function _find_post_category($post = null) { function _find_post_category($post = null) {
$found = array(); $found = array();
@ -501,14 +469,6 @@ class ComicPressStoryline {
return $found; return $found;
} }
function &include_post_category($post = null) {
return $this->_include('_find_post_category', $post);
}
function &exclude_post_category($post = null) {
return $this->_exclude('_find_post_category', $post);
}
function _find_adjacent($category = null, $next = false) { function _find_adjacent($category = null, $next = false) {
$found = array(); $found = array();
@ -524,15 +484,6 @@ class ComicPressStoryline {
return $found; return $found;
} }
function &include_adjacent($category = null, $next = false) {
return $this->_include('_find_adjacent', $category, $next);
}
function &exclude_adjacent($category = null, $next = false) {
return $this->_exclude('_find_adjacent', $category, $next);
}
function end_search() { function end_search() {
$result = $this->_category_search; $result = $this->_category_search;
$this->_category_search = array(); $this->_category_search = array();
@ -579,7 +530,8 @@ class ComicPressStoryline {
$method = $method_type; break; $method = $method_type; break;
} }
if (!empty($method)) { if (!empty($method)) {
call_user_func_array(array($this, "${method_root}_${method}"), $args); array_unshift($args, "_find_${method}");
call_user_func_array(array($this, "_${method_root}"), $args);
} }
} }
} }

View File

@ -7,7 +7,7 @@
RT('previous', 'from_post'); the_title(); echo '<br />'; RT('previous', 'from_post'); the_title(); echo '<br />';
RT('previous'); the_title(); echo '<br />'; RT('previous'); the_title(); echo '<br />';
Restore(); the_title(); echo '<br />'; Restore(); the_title(); echo '<br />';
RT('next'); the_title(); echo '<br />'; RT('next', array('child_of' => 'amoc')); the_title(); echo '<br />';
RT('next', 'from_post'); the_title(); echo '<br />'; RT('next', 'from_post'); the_title(); echo '<br />';
RT('last', 'from_post'); the_title(); echo '<br />'; RT('last', 'from_post'); the_title(); echo '<br />';

View File

@ -368,26 +368,6 @@ class ComicPressStorylineTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(array(2,3,4), $this->css->_find_children($search)); $this->assertEquals(array(2,3,4), $this->css->_find_children($search));
} }
function testIncludeChildren() {
$css = $this->getMock('ComicPressStoryline', array('_find_children'));
$css->expects($this->once())->method('_find_children')->will($this->returnValue(array(2,3,4)));
$css->_category_search = array(4,5);
$css->include_children(2);
$this->assertEquals(array(2,3,4,5), $css->_category_search);
}
function testExcludeChildren() {
$css = $this->getMock('ComicPressStoryline', array('_find_children'));
$css->expects($this->once())->method('_find_children')->will($this->returnValue(array(2,3,4)));
$css->_category_search = array(4, 5, 6);
$css->exclude_children(2);
$this->assertEquals(array(5, 6), $css->_category_search);
}
function testFindLevelOrAbove() { function testFindLevelOrAbove() {
$this->css->_structure = array( $this->css->_structure = array(
'1' => array('next' => 2, 'level' => 1), '1' => array('next' => 2, 'level' => 1),
@ -399,26 +379,6 @@ class ComicPressStorylineTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(array(1, 2), $this->css->_find_level_or_above(2)); $this->assertEquals(array(1, 2), $this->css->_find_level_or_above(2));
} }
function testIncludeLevelOrAbove() {
$css = $this->getMock('ComicPressStoryline', array('_find_level_or_above'));
$css->expects($this->once())->method('_find_level_or_above')->will($this->returnValue(array(2,3,4)));
$css->_category_search = array(4,5);
$css->include_level_or_above(2);
$this->assertEquals(array(2,3,4,5), $css->_category_search);
}
function testExcludeLevelOrAbove() {
$css = $this->getMock('ComicPressStoryline', array('_find_level_or_above'));
$css->expects($this->once())->method('_find_level_or_above')->will($this->returnValue(array(2,3,4)));
$css->_category_search = array(4, 5, 6);
$css->exclude_level_or_above(2);
$this->assertEquals(array(5, 6), $css->_category_search);
}
function testEndSearch() { function testEndSearch() {
$this->css->_category_search = array(1,2,3); $this->css->_category_search = array(1,2,3);
$this->assertEquals(array(1,2,3), $this->css->end_search()); $this->assertEquals(array(1,2,3), $this->css->end_search());
@ -514,7 +474,7 @@ class ComicPressStorylineTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($expected_return, $this->css->_find_adjacent($category, $which)); $this->assertEquals($expected_return, $this->css->_find_adjacent($category, $which));
} }
function providerTestBuildFromRestrictions() { function providerTestBuildFromRestrictions() {
return array( return array(
array( array(
null, null,