| 1 | <?php |
||
| 17 | class CountableTraitTest extends \PHPUnit_Framework_TestCase |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var BaseCollection |
||
| 21 | */ |
||
| 22 | private $collection; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * {@inheritdoc} |
||
| 26 | */ |
||
| 27 | public function setUp() |
||
| 28 | { |
||
| 29 | parent::setUp(); |
||
| 30 | |||
| 31 | $this->collection = new BaseCollection([1, 2, 3, 'a' => 4, 'b' => 5]); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Verify collection implements ArrayAccess interface |
||
| 36 | * |
||
| 37 | * @return void |
||
| 38 | */ |
||
| 39 | public function testImplementsInterface() |
||
| 40 | { |
||
| 41 | $this->assertInstanceOf(Countable::class, $this->collection); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Test collection count method |
||
| 46 | * |
||
| 47 | * @return void |
||
| 48 | */ |
||
| 49 | public function testCount() |
||
| 50 | { |
||
| 51 | $this->assertEquals(5, $this->collection->count()); |
||
| 52 | } |
||
| 53 | } |
||
| 54 |