Skip to content

Commit

Permalink
Merge pull request #2 from edwin-benitez/master
Browse files Browse the repository at this point in the history
Updating CodeceptionAdapter.php 'run' command
  • Loading branch information
maks-rafalko authored Mar 24, 2020
2 parents 63bf85d + dd20b60 commit 09dda58
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/CodeceptionAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ final class CodeceptionAdapter implements MemoryUsageAware, TestFrameworkAdapter
public const NAME = 'codeception';

private const DEFAULT_ARGS_AND_OPTIONS = [
'run',
'--no-colors',
'--fail-fast',
];
Expand Down Expand Up @@ -335,6 +334,7 @@ private function getInterceptorNamespacePrefix(): string
private function prepareArgumentsAndOptions(string $extraOptions): array
{
return array_filter(array_merge(
['run'],
explode(' ', $extraOptions),
self::DEFAULT_ARGS_AND_OPTIONS
));
Expand Down
18 changes: 18 additions & 0 deletions tests/phpunit/CodeceptionAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,24 @@ public function test_codeception_name(): void
self::assertSame('codeception', $this->createAdapter()->getName());
}

public function test_prepare_arguments_and_options_contains_run_first(): void
{
$adapter = $this->createAdapter();

$commandLine = $adapter->getMutantCommandLine(
[],
self::MUTATED_FILE_PATH,
self::MUTATION_HASH,
self::ORIGINAL_FILE_PATH,
'--skip blah'
);

self::assertStringContainsString(
'path/to/codeception run --skip blah',
implode(' ', $commandLine)
);
}

/**
* @param array<string, mixed>|null $config
*/
Expand Down

0 comments on commit 09dda58

Please sign in to comment.