shouldReceive('getAdminController')->andReturn($controller); $app = new class extends FOSSBilling\Core\Http\AppAdmin { public function setMod(string $mod): void { $this->mod = $mod; } }; $di = new Pimple\Container(); $di['request'] = Request::create('http://localhost/test'); $di['mod'] = $di->protect(static fn (): object => $mod); $app->setDi($di); $app->setMod('example'); return $app; } test('init skips controllers without a register method', function (): void { appAdminWithController(new stdClass())->init(); expect(true)->toBeTrue(); }); test('init registers controllers that have a register method', function (): void { $controller = new class { public bool $registered = false; public function register(object $app): void { $this->registered = true; } }; appAdminWithController($controller)->init(); expect($controller->registered)->toBeTrue(); });