Skip to content

Commit

Permalink
Merge pull request #109 from andrewandante/FIX_support_old_composer_pipe
Browse files Browse the repository at this point in the history
FIX allow single pipe for composer OR
  • Loading branch information
GuySartorelli authored Oct 10, 2024
2 parents 930371a + afc561d commit a9114cd
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion job_creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private function isAllowedPhpVersion(string $phpVersion)
}
$this->composerPhpConstraint = $json->require->php;
}
$constraints = explode('||', $this->composerPhpConstraint);
$constraints = preg_split('#(\|\||\|)#', $this->composerPhpConstraint);
$constraints = array_map(function($php) {
return preg_replace('#([0-9\.\*]+) *- *([0-9\.\*]+)#', '$1-$2', trim($php));
}, $constraints);
Expand Down
66 changes: 66 additions & 0 deletions tests/JobCreatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,72 @@ public function provideCreateJsonForConfig(): array
],
],
],
'cms 4 old composer pipe' => [
'branch' => '1.6',
'phpConstraint' => '^7.4 | ^8.0',
'expected' => [
[
'installer_version' => '',
'php' => '7.4',
'db' => DB_MYSQL_57,
'composer_require_extra' => '',
'composer_args' => '--prefer-lowest',
'name_suffix' => '',
'phpunit' => 'true',
'phpunit_suite' => 'all',
'phplinting' => 'false',
'phpcoverage' => 'false',
'endtoend' => 'false',
'endtoend_suite' => 'root',
'endtoend_config' => '',
'endtoend_tags' => '',
'js' => 'false',
'doclinting' => 'false',
'needs_full_setup' => 'false',
'name' => '7.4 prf-low mysql57 phpunit all',
],
[
'installer_version' => '',
'php' => '8.0',
'db' => DB_MYSQL_57_PDO,
'composer_require_extra' => '',
'composer_args' => '',
'name_suffix' => '',
'phpunit' => 'true',
'phpunit_suite' => 'all',
'phplinting' => 'false',
'phpcoverage' => 'false',
'endtoend' => 'false',
'endtoend_suite' => 'root',
'endtoend_config' => '',
'endtoend_tags' => '',
'js' => 'false',
'doclinting' => 'false',
'needs_full_setup' => 'false',
'name' => '8.0 mysql57pdo phpunit all',
],
[
'installer_version' => '',
'php' => '8.1',
'db' => DB_MYSQL_80,
'composer_require_extra' => '',
'composer_args' => '',
'name_suffix' => '',
'phpunit' => 'true',
'phpunit_suite' => 'all',
'phplinting' => 'false',
'phpcoverage' => 'false',
'endtoend' => 'false',
'endtoend_suite' => 'root',
'endtoend_config' => '',
'endtoend_tags' => '',
'js' => 'false',
'doclinting' => 'false',
'needs_full_setup' => 'false',
'name' => '8.1 mysql80 phpunit all',
],
],
],
'cms 5.1+' => [
'branch' => '2.1',
'phpConstraint' => '^8.1',
Expand Down

0 comments on commit a9114cd

Please sign in to comment.