public function testCreateWithArguments() { $applicationConfig = new ApplicationConfig(); $parentConfig = new CommandConfig('command', $applicationConfig); $config = new SubCommandConfig('sub-command', $parentConfig, $applicationConfig); $this->assertSame($parentConfig, $config->getParentConfig()); $this->assertSame($applicationConfig, $config->getApplicationConfig()); $this->assertSame('sub-command', $config->getName()); }
public function testAddSubCommandConfig() { $this->config->addSubCommandConfig($config1 = new SubCommandConfig('command1')); $this->config->addSubCommandConfig($config2 = new SubCommandConfig('command2')); $this->assertSame(array($config1, $config2), $this->config->getSubCommandConfigs()); $this->assertSame($this->applicationConfig, $config1->getApplicationConfig()); $this->assertSame($this->applicationConfig, $config2->getApplicationConfig()); }