spec\PhpSpec\CodeGenerator\Generator\NewFileNotifyingGeneratorSpec::it_should_dispatch_an_event_when_a_file_is_created PHP Метод

it_should_dispatch_an_event_when_a_file_is_created() публичный Метод

public it_should_dispatch_an_event_when_a_file_is_created ( $dispatcher, $filesystem, PhpSpec\Locator\Resource $resource )
$resource PhpSpec\Locator\Resource
    function it_should_dispatch_an_event_when_a_file_is_created($dispatcher, $filesystem, Resource $resource)
    {
        $path = '/foo';
        $resource->getSrcFilename()->willReturn($path);
        $event = new FileCreationEvent($path);
        $filesystem->pathExists($path)->willReturn(false, true);
        $this->generate($resource, array());
        $dispatcher->dispatch('afterFileCreation', $event)->shouldHaveBeenCalled();
    }