diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI index 5ae55908f0aa5112ec9bf4e2913c3a9fc680cfd7..978394246973b7ad97ae41df6b83cb3ab08a7b93 160000 --- a/tests/PHPUnit/UI +++ b/tests/PHPUnit/UI @@ -1 +1 @@ -Subproject commit 5ae55908f0aa5112ec9bf4e2913c3a9fc680cfd7 +Subproject commit 978394246973b7ad97ae41df6b83cb3ab08a7b93 diff --git a/tests/lib/screenshot-testing/support/test-environment.js b/tests/lib/screenshot-testing/support/test-environment.js index 7c0911d5cc7fdc9bd0eed3c45c76c99e8f5426bc..d7d837bec3b7936f480b2d23f58248643461f711 100644 --- a/tests/lib/screenshot-testing/support/test-environment.js +++ b/tests/lib/screenshot-testing/support/test-environment.js @@ -163,6 +163,35 @@ TestingEnvironment.prototype.setupFixture = function (fixtureClass, done) { }); }; +TestingEnvironment.prototype.readDbInfoFromConfig = function () { + + var username = 'root'; + var password = ''; + + var pathConfigIni = path.join(PIWIK_INCLUDE_PATH, "/config/config.ini.php"); + + var configFile = fs.read(pathConfigIni); + + if (configFile) { + var match = ('' + configFile).match(/password\s?=\s?"(.*)"/); + + if (match && match.length) { + password = match[1]; + } + + match = ('' + configFile).match(/username\s?=\s?"(.*)"/); + + if (match && match.length) { + username = match[1]; + } + } + + return { + username: username, + password: password + } +}; + TestingEnvironment.prototype.teardownFixture = function (fixtureClass, done) { if (options['persist-fixture-data'] || !fixtureClass