Skip to content

Commit

Permalink
Upgrade ondram/ci-detector to latest version (#1669)
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberro committed Feb 14, 2022
1 parent 4a1a2fd commit 90fe08d
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 59 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -53,7 +53,7 @@
"infection/include-interceptor": "^0.2.5",
"justinrainbow/json-schema": "^5.2.10",
"nikic/php-parser": "^4.13.2",
"ondram/ci-detector": "^3.3.0",
"ondram/ci-detector": "^4.1.0",
"sanmai/later": "^0.1.1",
"sanmai/pipeline": "^5.1 || ^6",
"sebastian/diff": "^3.0.2 || ^4.0",
Expand Down
102 changes: 54 additions & 48 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/Configuration/ConfigurationFactory.php
Expand Up @@ -52,7 +52,7 @@
use Infection\Mutator\MutatorParser;
use Infection\Mutator\MutatorResolver;
use Infection\TestFramework\TestFrameworkTypes;
use OndraM\CiDetector\CiDetector;
use OndraM\CiDetector\CiDetectorInterface;
use function Safe\sprintf;
use function sys_get_temp_dir;
use Webmozart\Assert\Assert;
Expand All @@ -74,7 +74,7 @@ class ConfigurationFactory
private MutatorFactory $mutatorFactory;
private MutatorParser $mutatorParser;
private SourceFileCollector $sourceFileCollector;
private CiDetector $ciDetector;
private CiDetectorInterface $ciDetector;
private GitDiffFileProvider $gitDiffFileProvider;

public function __construct(
Expand All @@ -83,7 +83,7 @@ public function __construct(
MutatorFactory $mutatorFactory,
MutatorParser $mutatorParser,
SourceFileCollector $sourceFileCollector,
CiDetector $ciDetector,
CiDetectorInterface $ciDetector,
GitDiffFileProvider $gitDiffFileProvider
) {
$this->tmpDirProvider = $tmpDirProvider;
Expand Down
4 changes: 2 additions & 2 deletions src/Environment/BuildContextResolver.php
Expand Up @@ -68,13 +68,13 @@ public function resolve(): BuildContext
throw new CouldNotResolveBuildContext('The repository name could not be determined for the current process');
}

if (trim($ci->getGitBranch()) === '') {
if (trim($ci->getBranch()) === '') {
throw new CouldNotResolveBuildContext('The branch name could not be determined for the current process');
}

return new BuildContext(
$ci->getRepositoryName(),
$ci->getGitBranch()
$ci->getBranch()
);
}
}
6 changes: 3 additions & 3 deletions tests/phpunit/Environment/BuildContextResolverTest.php
Expand Up @@ -123,7 +123,7 @@ public function test_resolve_throws_when_repository_name_is_empty(string $reposi
->willReturn($repositoryName);

$ci
->method('getGitBranch')
->method('getBranch')
->willReturn($gitBranch);

$ciDetector = $this->createMock(CiDetector::class);
Expand Down Expand Up @@ -158,7 +158,7 @@ public function test_resolve_throws_when_branch_name_is_empty(string $gitBranch)
->willReturn($repositoryName);

$ci
->method('getGitBranch')
->method('getBranch')
->willReturn($gitBranch);

$ciDetector = $this->createMock(CiDetector::class);
Expand Down Expand Up @@ -198,7 +198,7 @@ public function test_resolve_returns_build_context_when_ci_is_detected_and_build
->willReturn($repositoryName);

$ci
->method('getGitBranch')
->method('getBranch')
->willReturn($gitBranch);

$ciDetector = $this->createMock(CiDetector::class);
Expand Down
5 changes: 3 additions & 2 deletions tests/phpunit/Fixtures/DummyCiDetector.php
Expand Up @@ -7,11 +7,12 @@
use Infection\Tests\UnsupportedMethod;
use OndraM\CiDetector\Ci\CiInterface;
use OndraM\CiDetector\CiDetector;
use OndraM\CiDetector\CiDetectorInterface;
use OndraM\CiDetector\Env;

final class DummyCiDetector extends CiDetector
final class DummyCiDetector implements CiDetectorInterface
{
private $ciDetected;
private bool $ciDetected;

public function __construct(bool $ciDetected)
{
Expand Down

0 comments on commit 90fe08d

Please sign in to comment.