/** * @covers ::knowsDependency * @covers ::__construct */ public function testKnowsDependency() { $this->container->has('known_dependency')->willReturn(true); $this->container->has('unknown_dependency')->willReturn(false); $this->assertTrue($this->sut->knowsDependency('known_dependency')); $this->assertFalse($this->sut->knowsDependency('unknown_dependency')); }
public function testGetDirectory() { $path = 'path'; $this->prophecy->has($path)->willReturn(true); $this->prophecy->getMetadata($path)->willReturn(['path' => $path, 'type' => 'dir']); $output = $this->filesystem->get($path); $this->assertInstanceOf('League\\Flysystem\\Directory', $output); }
public static function containerDoesNotHaveService(ObjectProphecy $container, $service) { $container->has($service)->willReturn(false); }
/** * @covers ::has * * @dataProvider providerHas * * @param bool $exists * @param string $key */ public function testHas($exists, $key) { $this->decoratedFormState->has($key)->willReturn($exists)->shouldBeCalled(); $this->assertSame($exists, $this->formStateDecoratorBase->has($key)); }