Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix failing tests #237

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions phpunit.xml.dist
Expand Up @@ -10,6 +10,7 @@
<php>
<ini name="error_reporting" value="-1" />
<env name="TEST_DATABASE_DSN" value="mysql://root:@127.0.0.1:3306/test_maker" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak_vendors" />
</php>

<testsuites>
Expand Down
14 changes: 12 additions & 2 deletions src/Test/MakerTestEnvironment.php
Expand Up @@ -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
Expand Down Expand Up @@ -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' => '</php>',
'replace' => ' <env name="SYMFONY_DEPRECATIONS_HELPER" value="weak_vendors" />'."\n".' </php>',
],
];

$this->processReplacements($replacements, $this->flexPath);

MakerTestProcess::create('php bin/console cache:clear --no-warmup', $this->flexPath)
->run();
}
Expand Down