/** * Create application object. * * @param ContainerInterface $container * @param string $requestedName * @param null|array $options * * @return Application * * @throws ServiceNotFoundException if unable to resolve the service. * @throws ServiceNotCreatedException if an exception is raised when creating a service. * @throws ContainerException if any other error occurs. */ public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { $application = new Application(); $application->add($container->get(Command\JoinCommand::class)); $application->add($container->get(Command\PurgeCommand::class)); $application->add($container->get(Command\RunCommand::class)); $application->add($container->get(Command\ShowCommand::class)); $helperSet = $application->getHelperSet(); $helperSet->set($container->get(Helper\ConfigLoaderHelper::class)); return $application; }
/** * Test that the application has the correct name and version. */ public function testApplicationNameAndVersion() { $application = new Application(); $this->assertSame(Application::NAME, $application->getName()); $this->assertSame(Application::VERSION, $application->getVersion()); }