diff --git a/src/AmountPenceList.php b/src/AmountPenceList.php new file mode 100644 index 0000000..5f45216 --- /dev/null +++ b/src/AmountPenceList.php @@ -0,0 +1,24 @@ + + * + * List of AmountPence objects + */ +class AmountPenceList extends ObjectList +{ + + /** + * Return true if the value is acceptable for this list. Typically something like: + * return $value instanceof MyClass + * + * @param mixed $value + * @return boolean + */ + public function accepts($value) + { + return $value instanceof AmountPence; + } +} diff --git a/tests/AmountPenceListTest.php b/tests/AmountPenceListTest.php new file mode 100644 index 0000000..f0f407c --- /dev/null +++ b/tests/AmountPenceListTest.php @@ -0,0 +1,19 @@ + + */ +class AmountPenceListTest extends PHPUnit_Framework_TestCase +{ + + public function testAccept(){ + $list = new AmountPenceList(); + $list->append(new AmountPence(99)); + + $this->assertCount(1, $list); + } + +} \ No newline at end of file