Skip to content
Extraits de code Groupes Projets
Valider 798fcf1b rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Rename whitelist to blacklist since we're ignoring entries that are in the...

Rename whitelist to blacklist since we're ignoring entries that are in the list, not running code only for those entries.
parent 0199c3be
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -6,9 +6,9 @@ return array(
// UI tests will remove the port from all URLs to the test server. if a test
// requires the ports in UI tests (eg, Overlay), add the api/controller methods
// to one of these whitelists
'tests.ui.url_normalizer_whitelist.api' => array(),
'tests.ui.url_normalizer_whitelist.controller' => array(),
// to one of these blacklists
'tests.ui.url_normalizer_blacklist.api' => array(),
'tests.ui.url_normalizer_blacklist.controller' => array(),
'Piwik\Config' => \DI\decorate(function (\Piwik\Config $config) {
$config->General['cors_domains'][] = '*';
......@@ -24,19 +24,19 @@ return array(
array('Request.dispatch.end', function (&$result) {
$request = $_GET + $_POST;
$apiWhitelist = StaticContainer::get('tests.ui.url_normalizer_whitelist.api');
$apiblacklist = StaticContainer::get('tests.ui.url_normalizer_blacklist.api');
if (!empty($request['method'])
&& in_array($request['method'], $apiWhitelist)
&& in_array($request['method'], $apiblacklist)
) {
return;
}
$controllerActionWhitelist = StaticContainer::get('tests.ui.url_normalizer_whitelist.controller');
$controllerActionblacklist = StaticContainer::get('tests.ui.url_normalizer_blacklist.controller');
if (!empty($request['module'])
&& !empty($request['action'])
) {
$controllerAction = $request['module'] . '.' . $request['action'];
if (in_array($controllerAction, $controllerActionWhitelist)) {
if (in_array($controllerAction, $controllerActionblacklist)) {
return;
}
}
......
......@@ -4,10 +4,10 @@ return array(
// Overlay needs the full URLs in order to find the links in the embedded page (otherwise the %
// tooltips don't show up)
'tests.ui.url_normalizer_whitelist.api' => DI\add(array(
'tests.ui.url_normalizer_blacklist.api' => DI\add(array(
'Overlay.getFollowingPages',
)),
'tests.ui.url_normalizer_whitelist.controller' => DI\add(array(
'tests.ui.url_normalizer_blacklist.controller' => DI\add(array(
'Overlay.renderSidebar',
)),
......
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