Completed
Push — master ( 44b88c...ea2c59 )
by Pablo
03:18
created

CollectionTest::itShouldReturnCollection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace PhpValueObjects\Tests\Collection;
6
7
8
use PhpValueObjects\Collection\Exception\InvalidCollectionObjectException;
9
10
class CollectionTest extends \PHPUnit_Framework_TestCase
11
{
12
    /**
13
     * @test
14
     */
15
    public function itShouldThrowInvalidCollectionObjectException()
16
    {
17
        $this->expectException(InvalidCollectionObjectException::class);
18
19
        new Collection([new \stdClass(), new \stdClass()]);
20
    }
21
22
    /**
23
     * @test
24
     */
25
    public function itShouldReturnCollection()
26
    {
27
        $objects = [
28
            new ObjectForTest(),
29
            new ObjectForTest(),
30
            new ObjectForTest()
31
        ];
32
33
        $collection = new Collection($objects);
34
35
        $this->assertSame($objects, $collection->getCollection());
36
    }
37
38
    /**
39
     * @test
40
     */
41
    public function itShouldReturnEmptyCollection()
42
    {
43
        $collection = new Collection([]);
44
45
        $this->assertEmpty($collection->getCollection());
46
    }
47
}
48