-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make --filter case insensitive - issue #3181
- Loading branch information
1 parent
2c73693
commit 7c39e56
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <sebastian@phpunit.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\Runner\Filter; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class NameFilterIteratorTest extends TestCase | ||
{ | ||
public function testCaseSensitiveMatch() | ||
{ | ||
$iterator = $this->getTestSuiteItteratorMock(); | ||
$filter = new NameFilterIterator($iterator, 'Success'); | ||
$this->assertTrue((bool) $filter->accept()); | ||
} | ||
|
||
public function testCaseInsensitiveMatch() | ||
{ | ||
$iterator = $this->getTestSuiteItteratorMock(); | ||
$filter = new NameFilterIterator($iterator, 'success'); | ||
$this->assertTrue((bool) $filter->accept()); | ||
} | ||
|
||
/** | ||
* @return \PHPUnit\Framework\TestSuiteIterator | ||
*/ | ||
private function getTestSuiteItteratorMock() | ||
{ | ||
$success = new \Success(); | ||
$iterator = $this->createMock(\PHPUnit\Framework\TestSuiteIterator::class); | ||
$iterator->expects($this->once())->method('current')->willReturn($success); | ||
|
||
return $iterator; | ||
} | ||
} |