-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from assertis/amount_pence_list
AmountPenceList class introduced
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Assertis\Util; | ||
|
||
/** | ||
* @author Rafał Orłowski <[email protected]> | ||
* | ||
* 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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Assertis\Util; | ||
use PHPUnit_Framework_TestCase; | ||
|
||
/** | ||
* @author Rafał Orłowski <[email protected]> | ||
*/ | ||
class AmountPenceListTest extends PHPUnit_Framework_TestCase | ||
{ | ||
|
||
public function testAccept(){ | ||
$list = new AmountPenceList(); | ||
$list->append(new AmountPence(99)); | ||
|
||
$this->assertCount(1, $list); | ||
} | ||
|
||
} |