factory = new ApplicationFactory(); } #[Test] public function allCommandsWhichAreServicesAreAdded(): void { $sm = $this->createServiceManager([ 'commands' => [ 'foo' => 'foo', 'bar' => 'bar', 'baz' => 'baz', ], ]); $sm->setService('foo', CliTestUtils::createCommandMock('foo')); $sm->setService('bar', CliTestUtils::createCommandMock('bar')); $instance = ($this->factory)($sm); self::assertTrue($instance->has('foo')); self::assertTrue($instance->has('bar')); self::assertFalse($instance->has('baz')); } private function createServiceManager(array $config = []): ServiceManager { return new ServiceManager(['services' => [ 'config' => [ 'cli' => $config, ], AppOptions::class => new AppOptions(), ]]); } }