extension = new TranslatorExtension($this->prophesize(Translator::class)->reveal()); } /** * @test */ public function properFunctionsAreReturned() { $engine = $this->prophesize(Engine::class); $registerFunction = $engine->registerFunction('translate', Argument::type('callable'))->will(function () { }); $this->extension->register($engine->reveal()); $registerFunction->shouldHaveBeenCalledOnce(); } }