| @@ 33-45 (lines=13) @@ | ||
| 30 | $this->assertSame($this->connection, $this->executor->getConnection()); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function testExecuteSql() |
|
| 34 | { |
|
| 35 | $query = 'DELETE FROM some_table'; |
|
| 36 | ||
| 37 | $this->logger->expects($this->once()) |
|
| 38 | ->method('notice') |
|
| 39 | ->with($query); |
|
| 40 | $this->connection->expects($this->once()) |
|
| 41 | ->method('executeQuery') |
|
| 42 | ->with($query); |
|
| 43 | ||
| 44 | $this->executor->execute($query, false); |
|
| 45 | } |
|
| 46 | ||
| 47 | public function testExecuteSqlDryRun() |
|
| 48 | { |
|
| @@ 47-58 (lines=12) @@ | ||
| 44 | $this->executor->execute($query, false); |
|
| 45 | } |
|
| 46 | ||
| 47 | public function testExecuteSqlDryRun() |
|
| 48 | { |
|
| 49 | $query = 'DELETE FROM some_table'; |
|
| 50 | ||
| 51 | $this->logger->expects($this->once()) |
|
| 52 | ->method('notice') |
|
| 53 | ->with($query); |
|
| 54 | $this->connection->expects($this->never()) |
|
| 55 | ->method('executeQuery'); |
|
| 56 | ||
| 57 | $this->executor->execute($query, true); |
|
| 58 | } |
|
| 59 | ||
| 60 | public function testExecuteMigrationQuery() |
|
| 61 | { |
|
| @@ 60-71 (lines=12) @@ | ||
| 57 | $this->executor->execute($query, true); |
|
| 58 | } |
|
| 59 | ||
| 60 | public function testExecuteMigrationQuery() |
|
| 61 | { |
|
| 62 | $query = $this->getMock('RDV\Bundle\MigrationBundle\Migration\MigrationQuery'); |
|
| 63 | ||
| 64 | $query->expects($this->never()) |
|
| 65 | ->method('setConnection'); |
|
| 66 | $query->expects($this->once()) |
|
| 67 | ->method('execute') |
|
| 68 | ->with($this->identicalTo($this->logger)); |
|
| 69 | ||
| 70 | $this->executor->execute($query, false); |
|
| 71 | } |
|
| 72 | ||
| 73 | public function testExecuteConnectionAwareMigrationQuery() |
|
| 74 | { |
|