-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI run for test lowest installed deps
- Loading branch information
1 parent
0c34feb
commit c938bc8
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ phpunit.xml | |
vendor/ | ||
composer.lock | ||
.idea/ | ||
.phpunit.cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
$content = file_get_contents(dirname(__DIR__) . '/composer.lock'); | ||
|
||
$dependencies = json_decode($content, true, \JSON_THROW_ON_ERROR); | ||
|
||
$expectedDependencies = [ | ||
'doctrine/annotations' => '1.14.0', | ||
'doctrine/lexer' => '2.0.0', | ||
'doctrine/dbal' => '3.3.6', | ||
'doctrine/orm' => '2.19.0', | ||
]; | ||
|
||
foreach ($expectedDependencies as $expectedDependency => $expectedVersion) { | ||
$dependency = null; | ||
foreach ([...$dependencies['packages'], ...$dependencies['packages-dev']] as $package) { | ||
if ($package['name'] === $expectedDependency) { | ||
$dependency = $package; | ||
break; | ||
} | ||
} | ||
|
||
if (null === $dependency) { | ||
throw new RuntimeException('Missing dependency: ' . $expectedDependency); | ||
} | ||
|
||
$dependencyVersion = $dependency['version']; | ||
|
||
if ($dependencyVersion !== $expectedVersion) { | ||
throw new RuntimeException( | ||
sprintf( | ||
"Invalid version for %s. Expected: %s. Found: %s", | ||
$expectedDependency, | ||
$expectedVersion, | ||
$dependencyVersion | ||
) | ||
); | ||
} | ||
} | ||
|
||
echo 'All dependencies are correct.' . \PHP_EOL; |