Completed
Push — master ( 614b63...a2526c )
by Jacob
03:14
created

testConstructSetsConnections()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 11
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 11
loc 11
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace Jacobemerick\Web\Domain\Stream\Activity;
4
5
use Aura\Sql\ConnectionLocator;
6
use Aura\Sql\ExtendedPdo;
7
use PHPUnit_Framework_TestCase;
8
9 View Code Duplication
class MysqlActivityRepositoryTest extends PHPUnit_Framework_TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
12
    public function testIsInstanceOfActivityRepository()
13
    {
14
        $repository = new MysqlActivityRepository(new ConnectionLocator());
15
16
        $this->assertInstanceOf(
17
            'Jacobemerick\Web\Domain\Stream\Activity\MysqlActivityRepository',
18
            $repository
19
        );
20
    }
21
22
    public function testImplementsActivityInterface()
23
    {
24
        $repository = new MysqlActivityRepository(new ConnectionLocator());
25
26
        $this->assertInstanceOf(
27
            'Jacobemerick\Web\Domain\Stream\Activity\ActivityRepositoryInterface',
28
            $repository
29
        );
30
    }
31
32
    public function testConstructSetsConnections()
33
    {
34
        $connection = new ConnectionLocator();
35
        $respository = new MysqlActivityRepository($connection);
36
37
        $this->assertAttributeSame(
38
            $connection,
39
            'connections',
40
            $respository
41
        );
42
    }
43
}
44