| 1 | <?php |
||
| 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 |