+
+ function testUnableToSet() {
+ $this->configMock
+ ->shouldReceive('set')
+ ->with('test', 'it', 'now')
+ ->andReturn(false)
+ ->once();
+ $this->configMock
+ ->shouldReceive('get')
+ ->with('test', 'it')
+ ->andReturn(NULL)
+ ->once();
+ $console = new Config();
+ $console->setArgument(0, 'test');
+ $console->setArgument(1, 'it');
+ $console->setArgument(2, 'now');
+ $txt = $this->dumpExecute($console);
+ $this->assertSame("Unable to set test.it\n", $txt);
+ }
+
+ public function testGetHelp()
+ {
+ // Usable to purposely fail if new commands are added without taking tests into account
+ $theHelp = <<<HELP
+console config - Manage site configuration
+Synopsis
+ bin/console config [-h|--help|-?] [-v]
+ bin/console config <category> [-h|--help|-?] [-v]
+ bin/console config <category> <key> [-h|--help|-?] [-v]
+ bin/console config <category> <key> <value> [-h|--help|-?] [-v]
+
+Description
+ bin/console config
+ Lists all config values
+
+ bin/console config <category>
+ Lists all config values in the provided category
+
+ bin/console config <category> <key>
+ Shows the value of the provided key in the category
+
+ bin/console config <category> <key> <value>
+ Sets the value of the provided key in the category
+
+Notes:
+ Setting config entries which are manually set in config/local.config.php may result in
+ conflict between database settings and the manual startup settings.
+
+Options
+ -h|--help|-? Show help information
+ -v Show more debug information.
+
+HELP;
+ $console = new Config($this->consoleArgv);
+ $console->setOption('help', true);
+
+ $txt = $this->dumpExecute($console);
+
+ $this->assertEquals($txt, $theHelp);
+ }