Completed
Branch release/v1.0.0 (b932d7)
by Edward
03:07 queued 40s
created

CountableTraitTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 2
dl 0
loc 37
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A testImplementsInterface() 0 4 1
A testCount() 0 4 1
1
<?php
2
/**
3
 * File CountableTraitTest.php
4
 *
5
 * @author Edward Pfremmer <[email protected]>
6
 */
7
namespace Epfremme\Tests\Collection\Traits;
8
9
use Countable;
10
use Epfremme\Collection\BaseCollection;
11
12
/**
13
 * Class CountableTraitTest
14
 *
15
 * @package Epfremme\Tests\Collection\Traits
16
 */
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