X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fgherkin%2Ftests%2FBehat%2FGherkin%2FLoader%2FDirectoryLoaderTest.php;fp=vendor%2Fbehat%2Fgherkin%2Ftests%2FBehat%2FGherkin%2FLoader%2FDirectoryLoaderTest.php;h=0000000000000000000000000000000000000000;hp=de3270866ea5982fa1dd2100b1db29675ef23e51;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/DirectoryLoaderTest.php b/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/DirectoryLoaderTest.php deleted file mode 100644 index de3270866..000000000 --- a/vendor/behat/gherkin/tests/Behat/Gherkin/Loader/DirectoryLoaderTest.php +++ /dev/null @@ -1,92 +0,0 @@ -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')); - } -}