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