Foreach overwrites $variable with its value variable.

parent e17fcab8
...@@ -325,8 +325,8 @@ class SqlitePlatform extends AbstractPlatform ...@@ -325,8 +325,8 @@ class SqlitePlatform extends AbstractPlatform
$queryFields = $this->getColumnDeclarationListSQL($columns); $queryFields = $this->getColumnDeclarationListSQL($columns);
if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) {
foreach ($options['uniqueConstraints'] as $name => $definition) { foreach ($options['uniqueConstraints'] as $constraintName => $definition) {
$queryFields .= ', ' . $this->getUniqueConstraintDeclarationSQL($name, $definition); $queryFields .= ', ' . $this->getUniqueConstraintDeclarationSQL($constraintName, $definition);
} }
} }
......
...@@ -119,11 +119,7 @@ class CompositeExpression implements Countable ...@@ -119,11 +119,7 @@ class CompositeExpression implements Countable
{ {
$that = clone $this; $that = clone $this;
$that->parts[] = $part; $that->parts = array_merge($that->parts, [$part], $parts);
foreach ($parts as $part) {
$that->parts[] = $part;
}
return $that; return $that;
} }
......
...@@ -171,26 +171,24 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase ...@@ -171,26 +171,24 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase
); );
} }
$sequence = new Sequence('list_sequences_test_seq', 20, 10); $this->schemaManager->createSequence(
$this->schemaManager->createSequence($sequence); new Sequence('list_sequences_test_seq', 20, 10)
);
$sequences = $this->schemaManager->listSequences(); $sequences = $this->schemaManager->listSequences();
self::assertIsArray($sequences, 'listSequences() should return an array.'); self::assertIsArray($sequences, 'listSequences() should return an array.');
$foundSequence = null;
foreach ($sequences as $sequence) { foreach ($sequences as $sequence) {
self::assertInstanceOf(Sequence::class, $sequence, 'Array elements of listSequences() should be Sequence instances.'); if (strtolower($sequence->getName()) === 'list_sequences_test_seq') {
if (strtolower($sequence->getName()) !== 'list_sequences_test_seq') { self::assertSame(20, $sequence->getAllocationSize());
continue; self::assertSame(10, $sequence->getInitialValue());
}
$foundSequence = $sequence; return;
}
} }
self::assertNotNull($foundSequence, "Sequence with name 'list_sequences_test_seq' was not found."); self::fail('Sequence was not found.');
self::assertSame(20, $foundSequence->getAllocationSize(), 'Allocation Size is expected to be 20.');
self::assertSame(10, $foundSequence->getInitialValue(), 'Initial Value is expected to be 10.');
} }
public function testListDatabases() : void public function testListDatabases() : void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment