Browse files

Adding in a test case for lazy filter inheritance.

  • Loading branch information...
1 parent c7416ab commit 93f7d7b5addd37d4c3b6acad02c303dd22270081 @joebeeson joebeeson committed with jails Aug 29, 2011
Showing with 17 additions and 0 deletions.
  1. +10 −0 tests/cases/util/collection/FiltersTest.php
  2. +7 −0 tests/mocks/util/MockFiltersExtended.php
View
10 tests/cases/util/collection/FiltersTest.php
@@ -63,6 +63,16 @@ public function testLazyApply() {
$result = $class::filteredMethod();
$this->assertEqual($expected, $result);
}
+
+ public function testLazyApplyInheritance() {
+ $class = 'lithium\tests\mocks\util\MockFilters';
+ $child = 'lithium\tests\mocks\util\MockFiltersExtended';
+ Filters::apply($class, 'filteredMethod', function($self, $params, $chain) {
+ return md5($chain->next($self, $params, $chain));
+ });
+ $this->assertEqual(md5('Working?'), $child::filteredMethod());
+ }
+
}
?>
View
7 tests/mocks/util/MockFiltersExtended.php
@@ -0,0 +1,7 @@
+<?php
+
+ namespace lithium\tests\mocks\util;
+
+ class MockFiltersExtended extends MockFilters {
+
+ }

0 comments on commit 93f7d7b

Please sign in to comment.