Skip to content

Commit 09dda58

Browse files
authored
Merge pull request #2 from edwin-benitez/master
Updating CodeceptionAdapter.php 'run' command
2 parents 63bf85d + dd20b60 commit 09dda58

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/CodeceptionAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ final class CodeceptionAdapter implements MemoryUsageAware, TestFrameworkAdapter
5757
public const NAME = 'codeception';
5858

5959
private const DEFAULT_ARGS_AND_OPTIONS = [
60-
'run',
6160
'--no-colors',
6261
'--fail-fast',
6362
];
@@ -335,6 +334,7 @@ private function getInterceptorNamespacePrefix(): string
335334
private function prepareArgumentsAndOptions(string $extraOptions): array
336335
{
337336
return array_filter(array_merge(
337+
['run'],
338338
explode(' ', $extraOptions),
339339
self::DEFAULT_ARGS_AND_OPTIONS
340340
));

tests/phpunit/CodeceptionAdapterTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,24 @@ public function test_codeception_name(): void
357357
self::assertSame('codeception', $this->createAdapter()->getName());
358358
}
359359

360+
public function test_prepare_arguments_and_options_contains_run_first(): void
361+
{
362+
$adapter = $this->createAdapter();
363+
364+
$commandLine = $adapter->getMutantCommandLine(
365+
[],
366+
self::MUTATED_FILE_PATH,
367+
self::MUTATION_HASH,
368+
self::ORIGINAL_FILE_PATH,
369+
'--skip blah'
370+
);
371+
372+
self::assertStringContainsString(
373+
'path/to/codeception run --skip blah',
374+
implode(' ', $commandLine)
375+
);
376+
}
377+
360378
/**
361379
* @param array<string, mixed>|null $config
362380
*/

0 commit comments

Comments
 (0)