Skip to content

Commit

Permalink
AmountPenceList class introduced
Browse files Browse the repository at this point in the history
  • Loading branch information
orzeuek committed Sep 7, 2016
1 parent a30261a commit 8f082dd
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/AmountPenceList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Assertis\Util;

/**
* @author Rafał Orłowski <[email protected]>
*/
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 8f082dd

Please sign in to comment.