set password directly when adding new mysql user

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2019-07-26 07:34:32 +02:00
parent 5658717653
commit 7bc57ed269
2 changed files with 32 additions and 19 deletions

View File

@@ -26,8 +26,9 @@ class MysqlsTest extends TestCase
))->get();
$customer_userdata = json_decode($json_result, true)['data'];
$newPwd = \Froxlor\System\Crypt::generatePassword();
$data = [
'mysql_password' => \Froxlor\System\Crypt::generatePassword(),
'mysql_password' => $newPwd,
'description' => 'testdb',
'sendinfomail' => TRAVIS_CI == 1 ? 0 : 1
];
@@ -35,6 +36,14 @@ class MysqlsTest extends TestCase
$result = json_decode($json_result, true)['data'];
$this->assertEquals('testdb', $result['description']);
$this->assertEquals(0, $result['dbserver']);
// test connection
try {
$test_conn = new \PDO("mysql:host=localhost", 'test1sql1', $newPwd);
unset($test_conn);
} catch (PDOException $e) {
$this->fail($e->getMessage());
}
}
/**