Skip to content

Commit

Permalink
Merge pull request doctrine#7794 from lcobucci/fix-compatibility-with…
Browse files Browse the repository at this point in the history
…-dev-dependencies

Fix test compatibility with DBAL 2.10.x-dev
  • Loading branch information
lcobucci authored Aug 11, 2019
2 parents 6296bd4 + 869b70e commit 7e26d82
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 31 deletions.
30 changes: 9 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,31 @@ jobs:
mariadb: 10.1

- stage: Test
dist: xenial
env: DB=mysql MYSQL_VERSION=5.7
php: 7.1
addons:
apt:
sources:
- mysql-5.7-trusty
packages:
- mysql-server
- mysql-client
services:
- mysql
before_script:
- ./tests/travis/install-mysql-$MYSQL_VERSION.sh
sudo: required

- stage: Test
dist: xenial
env: DB=mysql MYSQL_VERSION=5.7
php: 7.2
addons:
apt:
sources:
- mysql-5.7-trusty
packages:
- mysql-server
- mysql-client
services:
- mysql
before_script:
- ./tests/travis/install-mysql-$MYSQL_VERSION.sh
sudo: required

- stage: Test
dist: xenial
env: DB=mysql MYSQL_VERSION=5.7
php: nightly
addons:
apt:
sources:
- mysql-5.7-trusty
packages:
- mysql-server
- mysql-client
services:
- mysql
before_script:
- ./tests/travis/install-mysql-$MYSQL_VERSION.sh
sudo: required
Expand Down
21 changes: 11 additions & 10 deletions tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,22 @@ public function testAddUniqueIndexForUniqueFieldAnnotation()
$this->assertTrue($schema->getTable('cms_users')->columnsAreIndexed(['username']), "username column should be indexed.");
}

public function testAnnotationOptionsAttribute()
public function testAnnotationOptionsAttribute() : void
{
$em = $this->_getTestEntityManager();
$schemaTool = new SchemaTool($em);

$classes = [
$em->getClassMetadata(TestEntityWithAnnotationOptionsAttribute::class),
];

$schema = $schemaTool->getSchemaFromMetadata($classes);

$expected = ['foo' => 'bar', 'baz' => ['key' => 'val']];
$schema = $schemaTool->getSchemaFromMetadata(
[$em->getClassMetadata(TestEntityWithAnnotationOptionsAttribute::class)]
);
$table = $schema->getTable('TestEntityWithAnnotationOptionsAttribute');

$this->assertEquals($expected, $schema->getTable('TestEntityWithAnnotationOptionsAttribute')->getOptions(), "options annotation are passed to the tables options");
$this->assertEquals($expected, $schema->getTable('TestEntityWithAnnotationOptionsAttribute')->getColumn('test')->getCustomSchemaOptions(), "options annotation are passed to the columns customSchemaOptions");
foreach ([$table->getOptions(), $table->getColumn('test')->getCustomSchemaOptions()] as $options) {
self::assertArrayHasKey('foo', $options);
self::assertSame('bar', $options['foo']);
self::assertArrayHasKey('baz', $options);
self::assertSame(['key' => 'val'], $options['baz']);
}
}

/**
Expand Down

0 comments on commit 7e26d82

Please sign in to comment.