mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
fix: checking existing argument with equal sign
This commit is contained in:
26
tests/Unit/Plugins/Concerns/HandleArguments.php
Normal file
26
tests/Unit/Plugins/Concerns/HandleArguments.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Pest\Plugins\Concerns\HandleArguments;
|
||||
|
||||
test('method hasArgument', function (string $argument, bool $expectedResult) {
|
||||
$obj = new class
|
||||
{
|
||||
use HandleArguments;
|
||||
};
|
||||
|
||||
$arguments = [
|
||||
'--long-argument',
|
||||
'someValue',
|
||||
'-a',
|
||||
'--with-equal-sign=1337',
|
||||
];
|
||||
|
||||
expect($obj->hasArgument($argument, $arguments))->toBe($expectedResult);
|
||||
})->with([
|
||||
['--long-argument', true],
|
||||
['-a', true],
|
||||
['--with-equal-sign', true],
|
||||
['someValue', true],
|
||||
['--a', false],
|
||||
['--undefined-argument', false],
|
||||
]);
|
||||
Reference in New Issue
Block a user