forked from sebastianbergmann/phpunit
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 sebastianbergmann#3181
- Loading branch information
Sebastian Feldmann
committed
Sep 7, 2018
1 parent
d8bdb50
commit 7047082
Showing
2 changed files
with
42 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
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; | ||
} | ||
} |