Commands fixes

This commit is contained in:
Dmitry Khomutov 2017-02-05 11:18:33 +07:00
commit ed532bad7d
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
24 changed files with 100 additions and 479 deletions

View file

@ -130,7 +130,20 @@ class InstallCommandTest extends \PHPUnit_Framework_TestCase
$this->executeWithoutParam(null, $dialog);
}
public function testDatabaseHostnameConfig()
public function testDatabaseTypeConfig()
{
$dialog = $this->getHelperMock();
// We specified an input value for hostname.
$dialog->expects($this->once())->method('ask')->willReturn('testedvalue');
$this->executeWithoutParam('--db-type', $dialog);
// Check that specified arguments are correctly loaded.
$this->assertEquals('testedvalue', $this->config['b8']['database']['type']);
}
public function testDatabaseHostConfig()
{
$dialog = $this->getHelperMock();
@ -144,6 +157,34 @@ class InstallCommandTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('testedvalue', $this->config['b8']['database']['servers']['write'][0]['host']);
}
public function testDatabaseStringPortConfig()
{
$dialog = $this->getHelperMock();
// We specified an input value for hostname.
$dialog->expects($this->once())->method('ask')->willReturn('testedvalue');
$this->executeWithoutParam('--db-port', $dialog);
// Check that specified arguments are correctly loaded.
$this->assertEquals(0, $this->config['b8']['database']['servers']['read'][0]['port']);
$this->assertEquals(0, $this->config['b8']['database']['servers']['write'][0]['port']);
}
public function testDatabasePortConfig()
{
$dialog = $this->getHelperMock();
// We specified an input value for hostname.
$dialog->expects($this->once())->method('ask')->willReturn('333');
$this->executeWithoutParam('--db-port', $dialog);
// Check that specified arguments are correctly loaded.
$this->assertEquals(333, $this->config['b8']['database']['servers']['read'][0]['port']);
$this->assertEquals(333, $this->config['b8']['database']['servers']['write'][0]['port']);
}
public function testDatabaseNameConfig()
{
$dialog = $this->getHelperMock();