Skip to content
Extraits de code Groupes Projets
Valider 008bae4f rédigé par mattab's avatar mattab
Parcourir les fichiers

Make UI tests use Morpheus theme by default, create Zeitgeist screenshots in...

Make UI tests use Morpheus theme by default, create Zeitgeist screenshots in he PHPUnit/UI/processed-ui-screenshots/Zeitgeist/ directory
parent ce9e7438
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -82,14 +82,14 @@ abstract class UITest extends IntegrationTestCase
list($processedScreenshotPath, $expectedScreenshotPath) = self::getProcessedAndExpectedScreenshotPaths($name);
$urls[] = array($processedScreenshotPath, $testUrl, $jsToTest);
// Screenshot Morpheus
list($processedScreenshotPath, $expectedScreenshotPath) = self::getProcessedAndExpectedScreenshotPaths($name, "Morpheus/");
$enableMorpheus = "&morpheus=1";
// Screenshot Zeitgeist
list($processedScreenshotPath, $expectedScreenshotPath) = self::getProcessedAndExpectedScreenshotPaths($name, "Zeitgeist/");
$enableZeitgeist = "&zeitgeist=1";
// Add the parameter to the query string, not the hash
if(($hash = strpos($testUrl, '#')) !== false) {
$testUrl = substr($testUrl, 0, $hash) . $enableMorpheus . substr($testUrl, $hash);
$testUrl = substr($testUrl, 0, $hash) . $enableZeitgeist . substr($testUrl, $hash);
} else {
$testUrl .= $enableMorpheus;
$testUrl .= $enableZeitgeist;
}
$urls[] = array($processedScreenshotPath, $testUrl, $jsToTest);
......
......@@ -31,17 +31,17 @@ function loadAllPluginsButOneTheme()
$themesNotToEnable = array('ExampleTheme', 'LeftMenu', 'PleineLune');
$enableMorpheus = !empty($_REQUEST['morpheus']);
if (!$enableMorpheus) {
$themesNotToEnable[] = 'Morpheus';
$enableZeitgeist = !empty($_REQUEST['zeitgeist']);
if (!$enableZeitgeist) {
$themesNotToEnable[] = 'Zeitgeist';
}
$pluginsToEnable = array_diff($pluginsToEnable, $themesNotToEnable);
\Piwik\Config::getInstance()->Plugins['Plugins'] = $pluginsToEnable;
return $enableMorpheus;
return $enableZeitgeist;
}
$enableMorpheus = loadAllPluginsButOneTheme();
$enableZeitgeist = loadAllPluginsButOneTheme();
$controller = \Piwik\FrontController::getInstance();
$controller->init();
......@@ -49,9 +49,9 @@ $controller->init();
$response = $controller->dispatch();
if($enableMorpheus) {
if($enableZeitgeist) {
$replace = "action=getCss";
$response = str_replace($replace, $replace . "&morpheus=1", $response);
$response = str_replace($replace, $replace . "&zeitgeist=1", $response);
}
if (!is_null($response)) {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter