%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/water/vendor/behat/gherkin/tests/Behat/Gherkin/Filter/ |
Upload File : |
<?php namespace Tests\Behat\Gherkin\Filter; use Behat\Gherkin\Filter\NameFilter; use Behat\Gherkin\Node\FeatureNode; use Behat\Gherkin\Node\ScenarioNode; class NameFilterTest extends \PHPUnit_Framework_TestCase { public function testFilterFeature() { $feature = new FeatureNode('feature1', null, array(), null, array(), null, null, null, 1); $filter = new NameFilter('feature1'); $this->assertSame($feature, $filter->filterFeature($feature)); $scenarios = array( new ScenarioNode('scenario1', array(), array(), null, 2), $matchedScenario = new ScenarioNode('scenario2', array(), array(), null, 4) ); $feature = new FeatureNode('feature1', null, array(), null, $scenarios, null, null, null, 1); $filter = new NameFilter('scenario2'); $filteredFeature = $filter->filterFeature($feature); $this->assertSame(array($matchedScenario), $filteredFeature->getScenarios()); } public function testIsFeatureMatchFilter() { $feature = new FeatureNode('random feature title', null, array(), null, array(), null, null, null, 1); $filter = new NameFilter('feature1'); $this->assertFalse($filter->isFeatureMatch($feature)); $feature = new FeatureNode('feature1', null, array(), null, array(), null, null, null, 1); $this->assertTrue($filter->isFeatureMatch($feature)); $feature = new FeatureNode('feature1 title', null, array(), null, array(), null, null, null, 1); $this->assertTrue($filter->isFeatureMatch($feature)); $feature = new FeatureNode('some feature1 title', null, array(), null, array(), null, null, null, 1); $this->assertTrue($filter->isFeatureMatch($feature)); $feature = new FeatureNode('some feature title', null, array(), null, array(), null, null, null, 1); $this->assertFalse($filter->isFeatureMatch($feature)); $filter = new NameFilter('/fea.ure/'); $this->assertTrue($filter->isFeatureMatch($feature)); $feature = new FeatureNode('some feaSure title', null, array(), null, array(), null, null, null, 1); $this->assertTrue($filter->isFeatureMatch($feature)); $feature = new FeatureNode('some feture title', null, array(), null, array(), null, null, null, 1); $this->assertFalse($filter->isFeatureMatch($feature)); } public function testIsScenarioMatchFilter() { $filter = new NameFilter('scenario1'); $scenario = new ScenarioNode('UNKNOWN', array(), array(), null, 2); $this->assertFalse($filter->isScenarioMatch($scenario)); $scenario = new ScenarioNode('scenario1', array(), array(), null, 2); $this->assertTrue($filter->isScenarioMatch($scenario)); $scenario = new ScenarioNode('scenario1 title', array(), array(), null, 2); $this->assertTrue($filter->isScenarioMatch($scenario)); $scenario = new ScenarioNode('some scenario title', array(), array(), null, 2); $this->assertFalse($filter->isScenarioMatch($scenario)); $filter = new NameFilter('/sce.ario/'); $this->assertTrue($filter->isScenarioMatch($scenario)); $filter = new NameFilter('/scen.rio/'); $this->assertTrue($filter->isScenarioMatch($scenario)); } }