Completed
Pull Request — master (#8)
by Саша
21:35
created

DbalLoaderSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 24
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace spec\Extraload\Loader\Doctrine;
4
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
use Doctrine\DBAL\Connection;
8
9
class DbalLoaderSpec extends ObjectBehavior
10
{
11
    function let(Connection $connection)
12
    {
13
        $this->beConstructedWith($connection, 'data');
14
    }
15
16
    function it_is_initializable()
17
    {
18
        $this->shouldHaveType('Extraload\Loader\Doctrine\DbalLoader');
19
    }
20
21
    function it_implements_loader_interface()
22
    {
23
        $this->shouldImplement('Extraload\Loader\LoaderInterface');
24
    }
25
26
    function it_loads_data_into_database_using_doctrine_dbal_connection(Connection $connection)
27
    {
28
        $connection->insert('data', ['a1', 'b1', 'c1'])->shouldBeCalled();
29
30
        $this->load(['a1', 'b1', 'c1']);
31
    }
32
}
33