Skip to content

Commit

Permalink
GL-2039: Applied fix for mutant TRUEVAL and FLASEVAL.
Browse files Browse the repository at this point in the history
  • Loading branch information
akashkska committed Feb 28, 2024
1 parent 56167cf commit 0dac450
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ public function testCommand(array $mockedGitlabProjects, array $inputs, array $a
// Assertions.

$this->assertEquals(0, $this->getStatusCode());

$this->mockGitLabVariables($this->gitLabProjectId, $projects, FALSE, TRUE);
$this->executeCommand($args, $inputs);
$this->assertEquals(1, $this->getStatusCode());

}

/**
Expand Down Expand Up @@ -515,12 +520,12 @@ protected function mockGitlabProjectType(int $gitlabProjectId): void {
$this->assertCount(2, $projectType);
}

protected function mockGitLabVariables(int $gitlabProjectId, ObjectProphecy $projects): void {
protected function mockGitLabVariables(int $gitlabProjectId, ObjectProphecy $projects, bool $masked = TRUE, bool $protected = FALSE): void {
$variables = $this->getMockGitLabVariables();
$projects->variables($gitlabProjectId)->willReturn($variables);
$projects->addVariable($gitlabProjectId, Argument::type('string'), Argument::type('string'), Argument::type('bool'), NULL, Argument::type('array'))->shouldBeCalled();
foreach ($variables as $variable) {
$projects->updateVariable($this->gitLabProjectId, $variable['key'], $variable['value'], FALSE, NULL, ['masked' => TRUE, 'variable_type' => 'env_var'])->shouldBeCalled();
$projects->updateVariable($this->gitLabProjectId, $variable['key'], $variable['value'], $protected, NULL, ['masked' => $masked, 'variable_type' => 'env_var'])->shouldBeCalled();
$maskedValue = $variable['masked'];
$this->assertEquals(TRUE, $maskedValue);
$protectedValue = $variable['protected'];
Expand Down

0 comments on commit 0dac450

Please sign in to comment.