From acc4baf930d8855ff033775ed65f394a86297eb4 Mon Sep 17 00:00:00 2001 From: Sadicov Vladimir Date: Tue, 7 Aug 2018 14:18:15 +0300 Subject: [PATCH 1/3] fix failing tests => suppress deprecated doctrine class error --- src/Test/MakerTestEnvironment.php | 10 ++++++++++ tests/Doctrine/EntityRegeneratorTest.php | 1 + 2 files changed, 11 insertions(+) diff --git a/src/Test/MakerTestEnvironment.php b/src/Test/MakerTestEnvironment.php index bd85696c6..7a82754d2 100644 --- a/src/Test/MakerTestEnvironment.php +++ b/src/Test/MakerTestEnvironment.php @@ -301,6 +301,16 @@ private function buildFlexSkeleton() MakerTestProcess::create('composer require phpunit browser-kit symfony/css-selector', $this->flexPath) ->run(); + $replacements = [ + [ + 'filename' => 'phpunit.xml.dist', + 'find' => '', + 'replace' => ' '."\n".' ' + ] + ]; + + $this->processReplacements($replacements, $this->flexPath); + MakerTestProcess::create('php bin/console cache:clear --no-warmup', $this->flexPath) ->run(); } diff --git a/tests/Doctrine/EntityRegeneratorTest.php b/tests/Doctrine/EntityRegeneratorTest.php index b54e92b1c..bab79291c 100644 --- a/tests/Doctrine/EntityRegeneratorTest.php +++ b/tests/Doctrine/EntityRegeneratorTest.php @@ -25,6 +25,7 @@ class EntityRegeneratorTest extends TestCase { /** + * @group legacy * @dataProvider getRegenerateEntitiesTests */ public function testRegenerateEntities(string $expectedDirName, bool $overwrite) From 77617e620a2f34ce6708fea69714cf04320e83da Mon Sep 17 00:00:00 2001 From: Sadicov Vladimir Date: Tue, 7 Aug 2018 14:29:32 +0300 Subject: [PATCH 2/3] cs fix --- src/Test/MakerTestEnvironment.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Test/MakerTestEnvironment.php b/src/Test/MakerTestEnvironment.php index 7a82754d2..40d05c6ae 100644 --- a/src/Test/MakerTestEnvironment.php +++ b/src/Test/MakerTestEnvironment.php @@ -56,9 +56,9 @@ private function __construct(MakerTestDetails $testDetails) $this->cachePath = realpath($cachePath); $this->flexPath = $this->cachePath.'/flex_project'; - $this->path = $this->cachePath.DIRECTORY_SEPARATOR.$testDetails->getUniqueCacheDirectoryName(); + $this->path = $this->cachePath.\DIRECTORY_SEPARATOR.$testDetails->getUniqueCacheDirectoryName(); - $this->snapshotFile = $this->path.DIRECTORY_SEPARATOR.basename($this->path).'.json'; + $this->snapshotFile = $this->path.\DIRECTORY_SEPARATOR.basename($this->path).'.json'; } public static function create(MakerTestDetails $testDetails): self @@ -305,8 +305,8 @@ private function buildFlexSkeleton() [ 'filename' => 'phpunit.xml.dist', 'find' => '', - 'replace' => ' '."\n".' ' - ] + 'replace' => ' '."\n".' ', + ], ]; $this->processReplacements($replacements, $this->flexPath); From 5e9ea1659801e0b0dc8b71bbaccedf049ead8142 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Tue, 7 Aug 2018 11:44:30 -0400 Subject: [PATCH 3/3] Using weak vendors This prevents our tests failing while Symfony uses a deprecated call from doctrine/common --- phpunit.xml.dist | 1 + tests/Doctrine/EntityRegeneratorTest.php | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c51b6b417..2d7abb832 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -10,6 +10,7 @@ + diff --git a/tests/Doctrine/EntityRegeneratorTest.php b/tests/Doctrine/EntityRegeneratorTest.php index bab79291c..b54e92b1c 100644 --- a/tests/Doctrine/EntityRegeneratorTest.php +++ b/tests/Doctrine/EntityRegeneratorTest.php @@ -25,7 +25,6 @@ class EntityRegeneratorTest extends TestCase { /** - * @group legacy * @dataProvider getRegenerateEntitiesTests */ public function testRegenerateEntities(string $expectedDirName, bool $overwrite)