createMock( \Config::class ); $config->expects( $this->once() ) ->method( 'get' ) ->with( 'Foo' ) ->willReturn( true ); $requirement = new DynamicConfigRequirement( $config, 'Foo', 'Bar' ); $this->assertTrue( $requirement->isMet() ); } /** * @covers ::isMet */ public function testItCastsConfigValue() { $config = new \HashConfig( [ 'Foo' => new \stdClass(), ] ); $requirement = new DynamicConfigRequirement( $config, 'Foo', 'Bar' ); $this->assertTrue( $requirement->isMet() ); } /** * @covers ::getName */ public function testItReturnsName() { $requirement = new DynamicConfigRequirement( new \HashConfig(), 'Foo', 'Bar' ); $this->assertEquals( 'Bar', $requirement->getName() ); } }