setDirection(FooPackerStub::class); $parser = new ParserPlugin(); $parser->assembly($rocket, function ($rocket) { return $rocket; }); } public function testPackerDefault() { Pay::set(ParserInterface::class, NoHttpRequestParser::class); $rocket = new Rocket(); $parser = new ParserPlugin(); $result = $parser->assembly($rocket, function ($rocket) { return $rocket; }); self::assertSame($rocket, $result); } public function testPackerObject() { Pay::set(ParserInterface::class, new NoHttpRequestParser()); $rocket = new Rocket(); $parser = new ParserPlugin(); $result = $parser->assembly($rocket, function ($rocket) { return $rocket; }); self::assertSame($rocket, $result); } }