Skip to content

Commit 292d819

Browse files
authored
Merge pull request #3642 from morozov/notice-for-non-valid-array-container
Fixed test failures on PHP 7.4
2 parents bf9d55c + 860b90b commit 292d819

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,20 @@ public function listTableDetails($tableName)
309309

310310
$tableOptions = $this->_conn->fetchAssoc($sql);
311311

312+
if ($tableOptions === false) {
313+
return $table;
314+
}
315+
312316
$table->addOption('engine', $tableOptions['ENGINE']);
317+
313318
if ($tableOptions['TABLE_COLLATION'] !== null) {
314319
$table->addOption('collation', $tableOptions['TABLE_COLLATION']);
315320
}
321+
316322
if ($tableOptions['AUTO_INCREMENT'] !== null) {
317323
$table->addOption('autoincrement', $tableOptions['AUTO_INCREMENT']);
318324
}
325+
319326
$table->addOption('comment', $tableOptions['TABLE_COMMENT']);
320327
$table->addOption('create_options', $this->parseCreateOptions($tableOptions['CREATE_OPTIONS']));
321328

lib/Doctrine/DBAL/Schema/Table.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class Table extends AbstractAsset
3434
protected $_fkConstraints = [];
3535

3636
/** @var mixed[] */
37-
protected $_options = [];
37+
protected $_options = [
38+
'create_options' => [],
39+
];
3840

3941
/** @var SchemaConfig|null */
4042
protected $_schemaConfig = null;
@@ -69,7 +71,7 @@ public function __construct($tableName, array $columns = [], array $indexes = []
6971
$this->_addForeignKeyConstraint($constraint);
7072
}
7173

72-
$this->_options = $options;
74+
$this->_options = array_merge($this->_options, $options);
7375
}
7476

7577
/**

tests/Doctrine/Tests/DBAL/Driver/OCI8/OCI8StatementTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ public function testExecute(array $params) : void
5959
$this->equalTo($params[2])
6060
);
6161

62+
// the return value is irrelevant to the test
63+
// but it has to be compatible with the method signature
64+
$statement->method('errorInfo')
65+
->willReturn(false);
66+
6267
// can't pass to constructor since we don't have a real database handle,
6368
// but execute must check the connection for the executeMode
6469
$conn = $this->getMockBuilder(OCI8Connection::class)

tests/Doctrine/Tests/DBAL/Sharding/PoolingShardManagerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public function testSelectGlobal() : void
4747
{
4848
$conn = $this->createConnectionMock();
4949
$conn->expects($this->once())->method('connect')->with($this->equalTo(0));
50+
$conn->method('getParams')
51+
->willReturn([
52+
'shardChoser' => $this->createMock(ShardChoser::class),
53+
]);
5054

5155
$shardManager = new PoolingShardManager($conn);
5256
$shardManager->selectGlobal();

0 commit comments

Comments
 (0)