mockClient = $this->getMockBuilder(ClientInterface::class)->getMock(); $this->expectedContainer = new FunctionContainer($this->mockClient); $this->factory = new ContainerFactory(); } /** * @return void */ public function testCreatesReturnsExistingCommandContainerClass(): void { $this->assertEquals( $this->expectedContainer, $this->factory::create($this->mockClient, 'function') ); } /** * @return void */ public function testThrowsExceptionOnNonExistingCommand(): void { $this->expectException(UnexpectedValueException::class); $this->expectExceptionMessage('Given command is not supported.'); $this->factory::create($this->mockClient, 'foobar'); } }