@@ -166,7 +166,7 @@ |
||
| 166 | 166 | $paramStr = 'foo'; |
| 167 | 167 | |
| 168 | 168 | $sql = "SELECT test_int, test_string FROM " . $this->_conn->quoteIdentifier($table) . " ". |
| 169 | - "WHERE test_int = " . $this->_conn->quote($paramInt) . " AND test_string = " . $this->_conn->quote($paramStr); |
|
| 169 | + "WHERE test_int = " . $this->_conn->quote($paramInt) . " AND test_string = " . $this->_conn->quote($paramStr); |
|
| 170 | 170 | $stmt = $this->_conn->prepare($sql); |
| 171 | 171 | self::assertInstanceOf('Doctrine\DBAL\Statement', $stmt); |
| 172 | 172 | } |
@@ -95,9 +95,9 @@ |
||
| 95 | 95 | $this->_conn->insert('modify_limit_table2', array('test_int' => 2)); |
| 96 | 96 | |
| 97 | 97 | $sql = "SELECT modify_limit_table.test_int FROM modify_limit_table " . |
| 98 | - "INNER JOIN modify_limit_table2 ON modify_limit_table.test_int = modify_limit_table2.test_int ". |
|
| 99 | - "GROUP BY modify_limit_table.test_int " . |
|
| 100 | - "ORDER BY modify_limit_table.test_int ASC"; |
|
| 98 | + "INNER JOIN modify_limit_table2 ON modify_limit_table.test_int = modify_limit_table2.test_int ". |
|
| 99 | + "GROUP BY modify_limit_table.test_int " . |
|
| 100 | + "ORDER BY modify_limit_table.test_int ASC"; |
|
| 101 | 101 | $this->assertLimitResult(array(1, 2), $sql, 10, 0); |
| 102 | 102 | $this->assertLimitResult(array(1), $sql, 1, 0); |
| 103 | 103 | $this->assertLimitResult(array(2), $sql, 1, 1); |
@@ -103,18 +103,18 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | $stmt = $conn->query('SELECT * FROM portability_table'); |
| 105 | 105 | foreach ($stmt as $row) { |
| 106 | - $this->assertFetchResultRow($row); |
|
| 106 | + $this->assertFetchResultRow($row); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | $stmt = $conn->query('SELECT * FROM portability_table'); |
| 110 | 110 | while (($row = $stmt->fetch())) { |
| 111 | - $this->assertFetchResultRow($row); |
|
| 111 | + $this->assertFetchResultRow($row); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | $stmt = $conn->prepare('SELECT * FROM portability_table'); |
| 115 | 115 | $stmt->execute(); |
| 116 | 116 | while (($row = $stmt->fetch())) { |
| 117 | - $this->assertFetchResultRow($row); |
|
| 117 | + $this->assertFetchResultRow($row); |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
@@ -150,8 +150,8 @@ discard block |
||
| 150 | 150 | ->getMock(); |
| 151 | 151 | |
| 152 | 152 | $driverMock->expects($this->once()) |
| 153 | - ->method('connect') |
|
| 154 | - ->will($this->returnValue(null)); |
|
| 153 | + ->method('connect') |
|
| 154 | + ->will($this->returnValue(null)); |
|
| 155 | 155 | |
| 156 | 156 | $connection = new ConnectionPortability($params, $driverMock); |
| 157 | 157 | |
@@ -12,14 +12,14 @@ discard block |
||
| 12 | 12 | ->setMethods(array('getCreateTableSql', 'getCreateSequenceSql', 'getCreateForeignKeySql')) |
| 13 | 13 | ->getMock(); |
| 14 | 14 | $platformMock->expects($this->exactly(2)) |
| 15 | - ->method('getCreateTableSql') |
|
| 16 | - ->will($this->returnValue(array("foo"))); |
|
| 15 | + ->method('getCreateTableSql') |
|
| 16 | + ->will($this->returnValue(array("foo"))); |
|
| 17 | 17 | $platformMock->expects($this->exactly(1)) |
| 18 | - ->method('getCreateSequenceSql') |
|
| 19 | - ->will($this->returnValue("bar")); |
|
| 18 | + ->method('getCreateSequenceSql') |
|
| 19 | + ->will($this->returnValue("bar")); |
|
| 20 | 20 | $platformMock->expects($this->exactly(1)) |
| 21 | - ->method('getCreateForeignKeySql') |
|
| 22 | - ->will($this->returnValue("baz")); |
|
| 21 | + ->method('getCreateForeignKeySql') |
|
| 22 | + ->will($this->returnValue("baz")); |
|
| 23 | 23 | |
| 24 | 24 | $schema = $this->createFixtureSchema(); |
| 25 | 25 | |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | ->setMethods(array('getDropTableSql', 'getDropSequenceSql', 'getDropForeignKeySql')) |
| 35 | 35 | ->getMock(); |
| 36 | 36 | $platformMock->expects($this->exactly(2)) |
| 37 | - ->method('getDropTableSql') |
|
| 38 | - ->will($this->returnValue("tbl")); |
|
| 37 | + ->method('getDropTableSql') |
|
| 38 | + ->will($this->returnValue("tbl")); |
|
| 39 | 39 | $platformMock->expects($this->exactly(1)) |
| 40 | - ->method('getDropSequenceSql') |
|
| 41 | - ->will($this->returnValue("seq")); |
|
| 40 | + ->method('getDropSequenceSql') |
|
| 41 | + ->will($this->returnValue("seq")); |
|
| 42 | 42 | $platformMock->expects($this->exactly(1)) |
| 43 | - ->method('getDropForeignKeySql') |
|
| 44 | - ->will($this->returnValue("fk")); |
|
| 43 | + ->method('getDropForeignKeySql') |
|
| 44 | + ->will($this->returnValue("fk")); |
|
| 45 | 45 | |
| 46 | 46 | $schema = $this->createFixtureSchema(); |
| 47 | 47 | |
@@ -42,44 +42,44 @@ |
||
| 42 | 42 | ->will($this->returnValue('create_schema')); |
| 43 | 43 | if ($unsafe) { |
| 44 | 44 | $platform->expects($this->exactly(1)) |
| 45 | - ->method('getDropSequenceSql') |
|
| 46 | - ->with($this->isInstanceOf('Doctrine\DBAL\Schema\Sequence')) |
|
| 47 | - ->will($this->returnValue('drop_seq')); |
|
| 45 | + ->method('getDropSequenceSql') |
|
| 46 | + ->with($this->isInstanceOf('Doctrine\DBAL\Schema\Sequence')) |
|
| 47 | + ->will($this->returnValue('drop_seq')); |
|
| 48 | 48 | } |
| 49 | 49 | $platform->expects($this->exactly(1)) |
| 50 | - ->method('getAlterSequenceSql') |
|
| 51 | - ->with($this->isInstanceOf('Doctrine\DBAL\Schema\Sequence')) |
|
| 52 | - ->will($this->returnValue('alter_seq')); |
|
| 50 | + ->method('getAlterSequenceSql') |
|
| 51 | + ->with($this->isInstanceOf('Doctrine\DBAL\Schema\Sequence')) |
|
| 52 | + ->will($this->returnValue('alter_seq')); |
|
| 53 | 53 | $platform->expects($this->exactly(1)) |
| 54 | - ->method('getCreateSequenceSql') |
|
| 55 | - ->with($this->isInstanceOf('Doctrine\DBAL\Schema\Sequence')) |
|
| 56 | - ->will($this->returnValue('create_seq')); |
|
| 54 | + ->method('getCreateSequenceSql') |
|
| 55 | + ->with($this->isInstanceOf('Doctrine\DBAL\Schema\Sequence')) |
|
| 56 | + ->will($this->returnValue('create_seq')); |
|
| 57 | 57 | if ($unsafe) { |
| 58 | 58 | $platform->expects($this->exactly(1)) |
| 59 | - ->method('getDropTableSql') |
|
| 60 | - ->with($this->isInstanceof('Doctrine\DBAL\Schema\Table')) |
|
| 61 | - ->will($this->returnValue('drop_table')); |
|
| 59 | + ->method('getDropTableSql') |
|
| 60 | + ->with($this->isInstanceof('Doctrine\DBAL\Schema\Table')) |
|
| 61 | + ->will($this->returnValue('drop_table')); |
|
| 62 | 62 | } |
| 63 | 63 | $platform->expects($this->exactly(1)) |
| 64 | - ->method('getCreateTableSql') |
|
| 65 | - ->with($this->isInstanceof('Doctrine\DBAL\Schema\Table')) |
|
| 66 | - ->will($this->returnValue(array('create_table'))); |
|
| 64 | + ->method('getCreateTableSql') |
|
| 65 | + ->with($this->isInstanceof('Doctrine\DBAL\Schema\Table')) |
|
| 66 | + ->will($this->returnValue(array('create_table'))); |
|
| 67 | 67 | $platform->expects($this->exactly(1)) |
| 68 | - ->method('getCreateForeignKeySQL') |
|
| 69 | - ->with($this->isInstanceOf('Doctrine\DBAL\Schema\ForeignKeyConstraint')) |
|
| 70 | - ->will($this->returnValue('create_foreign_key')); |
|
| 68 | + ->method('getCreateForeignKeySQL') |
|
| 69 | + ->with($this->isInstanceOf('Doctrine\DBAL\Schema\ForeignKeyConstraint')) |
|
| 70 | + ->will($this->returnValue('create_foreign_key')); |
|
| 71 | 71 | $platform->expects($this->exactly(1)) |
| 72 | - ->method('getAlterTableSql') |
|
| 73 | - ->with($this->isInstanceOf('Doctrine\DBAL\Schema\TableDiff')) |
|
| 74 | - ->will($this->returnValue(array('alter_table'))); |
|
| 72 | + ->method('getAlterTableSql') |
|
| 73 | + ->with($this->isInstanceOf('Doctrine\DBAL\Schema\TableDiff')) |
|
| 74 | + ->will($this->returnValue(array('alter_table'))); |
|
| 75 | 75 | if ($unsafe) { |
| 76 | 76 | $platform->expects($this->exactly(1)) |
| 77 | - ->method('getDropForeignKeySql') |
|
| 78 | - ->with( |
|
| 79 | - $this->isInstanceof('Doctrine\DBAL\Schema\ForeignKeyConstraint'), |
|
| 80 | - $this->isInstanceOf('Doctrine\DBAL\Schema\Table') |
|
| 81 | - ) |
|
| 82 | - ->will($this->returnValue('drop_orphan_fk')); |
|
| 77 | + ->method('getDropForeignKeySql') |
|
| 78 | + ->with( |
|
| 79 | + $this->isInstanceof('Doctrine\DBAL\Schema\ForeignKeyConstraint'), |
|
| 80 | + $this->isInstanceOf('Doctrine\DBAL\Schema\Table') |
|
| 81 | + ) |
|
| 82 | + ->will($this->returnValue('drop_orphan_fk')); |
|
| 83 | 83 | } |
| 84 | 84 | $platform->expects($this->exactly(1)) |
| 85 | 85 | ->method('supportsSchemas') |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | $mock = $this->createMock('Doctrine\DBAL\Sharding\ShardChoser\ShardChoser'); |
| 36 | 36 | $mock->expects($this->any()) |
| 37 | - ->method('pickShard') |
|
| 38 | - ->will($this->returnCallback(function($value) { return $value; })); |
|
| 37 | + ->method('pickShard') |
|
| 38 | + ->will($this->returnCallback(function($value) { return $value; })); |
|
| 39 | 39 | return $mock; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -102,14 +102,14 @@ discard block |
||
| 102 | 102 | )); |
| 103 | 103 | $conn->expects($this->at(2))->method('connect')->with($this->equalTo(1)); |
| 104 | 104 | $conn->expects($this->at(3)) |
| 105 | - ->method('fetchAll') |
|
| 106 | - ->with($this->equalTo($sql), $this->equalTo($params), $this->equalTo($types)) |
|
| 107 | - ->will($this->returnValue(array( array('id' => 1) ) )); |
|
| 105 | + ->method('fetchAll') |
|
| 106 | + ->with($this->equalTo($sql), $this->equalTo($params), $this->equalTo($types)) |
|
| 107 | + ->will($this->returnValue(array( array('id' => 1) ) )); |
|
| 108 | 108 | $conn->expects($this->at(4))->method('connect')->with($this->equalTo(2)); |
| 109 | 109 | $conn->expects($this->at(5)) |
| 110 | - ->method('fetchAll') |
|
| 111 | - ->with($this->equalTo($sql), $this->equalTo($params), $this->equalTo($types)) |
|
| 112 | - ->will($this->returnValue(array( array('id' => 2) ) )); |
|
| 110 | + ->method('fetchAll') |
|
| 111 | + ->with($this->equalTo($sql), $this->equalTo($params), $this->equalTo($types)) |
|
| 112 | + ->will($this->returnValue(array( array('id' => 2) ) )); |
|
| 113 | 113 | |
| 114 | 114 | $shardManager = new PoolingShardManager($conn, $this->createPassthroughShardChoser()); |
| 115 | 115 | $result = $shardManager->queryAll($sql, $params, $types); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | array(ParameterType::INTEGER), |
| 222 | 222 | ), |
| 223 | 223 | |
| 224 | - // Named parameters : Very simple with param int and string |
|
| 224 | + // Named parameters : Very simple with param int and string |
|
| 225 | 225 | array( |
| 226 | 226 | "SELECT * FROM Foo WHERE foo = :foo AND bar = :bar", |
| 227 | 227 | array('bar'=>'Some String','foo'=>1), |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | array("Some String","Some String"), |
| 285 | 285 | array(ParameterType::STRING,ParameterType::STRING,) |
| 286 | 286 | ), |
| 287 | - // Named parameters : With the same name arg |
|
| 287 | + // Named parameters : With the same name arg |
|
| 288 | 288 | array( |
| 289 | 289 | "SELECT * FROM Foo WHERE foo IN (:arg) AND NOT bar IN (:arg)", |
| 290 | 290 | array('arg'=>array(1, 2, 3)), |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | array(ParameterType::INTEGER,ParameterType::INTEGER, ParameterType::INTEGER,ParameterType::INTEGER,ParameterType::INTEGER, ParameterType::INTEGER) |
| 295 | 295 | ), |
| 296 | 296 | |
| 297 | - // Named parameters : Same name, other name in between DBAL-299 |
|
| 297 | + // Named parameters : Same name, other name in between DBAL-299 |
|
| 298 | 298 | array( |
| 299 | 299 | "SELECT * FROM Foo WHERE (:foo = 2) AND (:bar = 3) AND (:foo = 2)", |
| 300 | 300 | array('foo'=>2,'bar'=>3), |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | array(2, 3, 2), |
| 304 | 304 | array(ParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER) |
| 305 | 305 | ), |
| 306 | - // Named parameters : Empty "integer" array DDC-1978 |
|
| 306 | + // Named parameters : Empty "integer" array DDC-1978 |
|
| 307 | 307 | array( |
| 308 | 308 | "SELECT * FROM Foo WHERE foo IN (:foo)", |
| 309 | 309 | array('foo'=>array()), |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | array(), |
| 313 | 313 | array() |
| 314 | 314 | ), |
| 315 | - // Named parameters : Two empty "str" array DDC-1978 |
|
| 315 | + // Named parameters : Two empty "str" array DDC-1978 |
|
| 316 | 316 | array( |
| 317 | 317 | "SELECT * FROM Foo WHERE foo IN (:foo) OR bar IN (:bar)", |
| 318 | 318 | array('foo'=>array(), 'bar'=>array()), |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | array(), |
| 440 | 440 | array('bar' => Connection::PARAM_INT_ARRAY), |
| 441 | 441 | ), |
| 442 | - array( |
|
| 442 | + array( |
|
| 443 | 443 | "SELECT * FROM foo WHERE bar = :param", |
| 444 | 444 | array('bar' => 'value'), |
| 445 | 445 | array('bar' => Connection::PARAM_INT_ARRAY), |
@@ -14,8 +14,8 @@ |
||
| 14 | 14 | { |
| 15 | 15 | $connectionMock = $this->createMock('Doctrine\DBAL\Connection'); |
| 16 | 16 | $connectionMock->expects($this->once()) |
| 17 | - ->method('executeUpdate') |
|
| 18 | - ->with($this->isType('string')); |
|
| 17 | + ->method('executeUpdate') |
|
| 18 | + ->with($this->isType('string')); |
|
| 19 | 19 | |
| 20 | 20 | $eventArgs = new ConnectionEventArgs($connectionMock); |
| 21 | 21 | |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | { |
| 14 | 14 | $connectionMock = $this->createMock('Doctrine\DBAL\Connection'); |
| 15 | 15 | $connectionMock->expects($this->once()) |
| 16 | - ->method('executeUpdate') |
|
| 17 | - ->with($this->equalTo("SET NAMES foo COLLATE bar")); |
|
| 16 | + ->method('executeUpdate') |
|
| 17 | + ->with($this->equalTo("SET NAMES foo COLLATE bar")); |
|
| 18 | 18 | |
| 19 | 19 | $eventArgs = new ConnectionEventArgs($connectionMock); |
| 20 | 20 | |