Skip to content

Commit

Permalink
Merge pull request #19 from assertis/amount_pence_list
Browse files Browse the repository at this point in the history
AmountPenceList class introduced
  • Loading branch information
orzeuek authored Sep 8, 2016
2 parents a30261a + f81c6f8 commit 8791966
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/AmountPenceList.php
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;
}
}
19 changes: 19 additions & 0 deletions tests/AmountPenceListTest.php
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);
}

}

0 comments on commit 8791966

Please sign in to comment.