spec\PhpSpec\Locator\PSR0\PSR0LocatorSpec::it_throws_an_exception_on_no_class_definition PHP 메소드

it_throws_an_exception_on_no_class_definition() 공개 메소드

public it_throws_an_exception_on_no_class_definition ( Filesystem $fs, SplFileInfo $file )
$fs PhpSpec\Util\Filesystem
$file SplFileInfo
    function it_throws_an_exception_on_no_class_definition(Filesystem $fs, SplFileInfo $file)
    {
        $this->beConstructedWith($fs, 'PhpSpec', 'spec', $this->srcPath, $this->specPath);
        $filePath = $this->specPath . $this->convert_to_path('/spec/PhpSpec/Some/ClassSpec.php');
        $fs->pathExists($this->specPath . $this->convert_to_path('/spec/PhpSpec/'))->willReturn(true);
        $fs->findSpecFilesIn($this->specPath . $this->convert_to_path('/spec/PhpSpec/'))->willReturn(array($file));
        $fs->getFileContents($filePath)->willReturn('no class definition');
        $file->getRealPath()->willReturn($filePath);
        $exception = new \RuntimeException(sprintf('Spec file "%s" does not contains any class definition.', $filePath));
        $this->shouldThrow($exception)->duringFindResources($this->srcPath);
    }
PSR0LocatorSpec