%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/Loader/ |
Upload File : |
<?php namespace Tests\Behat\Gherkin\Loader; use Behat\Gherkin\Loader\DirectoryLoader; class DirectoryLoaderTest extends \PHPUnit_Framework_TestCase { private $gherkin; private $loader; private $featuresPath; protected function setUp() { $this->gherkin = $this->createGherkinMock(); $this->loader = new DirectoryLoader($this->gherkin); $this->featuresPath = realpath(__DIR__ . '/../Fixtures/directories'); } protected function createGherkinMock() { $gherkin = $this->getMockBuilder('Behat\Gherkin\Gherkin') ->disableOriginalConstructor() ->getMock(); return $gherkin; } protected function createGherkinFileLoaderMock() { $loader = $this->getMockBuilder('Behat\Gherkin\Loader\GherkinFileLoader') ->disableOriginalConstructor() ->getMock(); return $loader; } public function testSupports() { $this->assertFalse($this->loader->supports('non-existent path')); $this->assertFalse($this->loader->supports('non-existent path:2')); $this->assertFalse($this->loader->supports(__DIR__ . ':d')); $this->assertFalse($this->loader->supports(__DIR__ . '/../Fixtures/features/pystring.feature')); $this->assertTrue($this->loader->supports(__DIR__)); $this->assertTrue($this->loader->supports(__DIR__ . '/../Fixtures/features')); } public function testUndefinedFileLoad() { $this->gherkin ->expects($this->once()) ->method('resolveLoader') ->with($this->featuresPath.DIRECTORY_SEPARATOR.'phps'.DIRECTORY_SEPARATOR.'some_file.php') ->will($this->returnValue(null)); $this->assertEquals(array(), $this->loader->load($this->featuresPath . '/phps')); } public function testBasePath() { $this->gherkin ->expects($this->once()) ->method('resolveLoader') ->with($this->featuresPath.DIRECTORY_SEPARATOR.'phps'.DIRECTORY_SEPARATOR.'some_file.php') ->will($this->returnValue(null)); $this->loader->setBasePath($this->featuresPath); $this->assertEquals(array(), $this->loader->load('phps')); } public function testDefinedFileLoad() { $loaderMock = $this->createGherkinFileLoaderMock(); $this->gherkin ->expects($this->once()) ->method('resolveLoader') ->with($this->featuresPath.DIRECTORY_SEPARATOR.'phps'.DIRECTORY_SEPARATOR.'some_file.php') ->will($this->returnValue($loaderMock)); $loaderMock ->expects($this->once()) ->method('load') ->with($this->featuresPath.DIRECTORY_SEPARATOR.'phps'.DIRECTORY_SEPARATOR.'some_file.php') ->will($this->returnValue(array('feature1', 'feature2'))); $this->assertEquals(array('feature1', 'feature2'), $this->loader->load($this->featuresPath . '/phps')); } }