Skip to content
Extraits de code Groupes Projets
Valider 6ae5b6c6 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

Merge remote-tracking branch 'origin/master' into report_and_dimension_refactoring

parents c01d57bc dea3e061
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -28,6 +28,6 @@
"piwik/device-detector": "2.*"
},
"require-dev": {
"phpunit/phpunit": "4.*"
"phpunit/phpunit": "~4.1"
}
}
......@@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "016b7b6646d1d3ec6d8b574b5a6c5561",
"hash": "a369c506837f7af17cd3258c889e3b57",
"packages": [
{
"name": "leafo/lessphp",
......
......@@ -234,7 +234,7 @@ class CliMulti {
} catch (\Exception $e) {
$message = "Got invalid response from API request: $url. ";
if (empty($response)) {
if (isset($response) && empty($response)) {
$message .= "The response was empty. This usually means a server error. This solution to this error is generally to increase the value of 'memory_limit' in your php.ini file. Please check your Web server Error Log file for more details.";
} else {
$message .= "Response was '" . $e->getMessage() . "'";
......
......@@ -384,6 +384,7 @@ class Config extends Singleton
}
} else {
$values = htmlentities($values, ENT_COMPAT, 'UTF-8');
$values = str_replace('$', '$', $values);
}
return $values;
}
......
......@@ -1320,6 +1320,10 @@ class CronArchive
*/
private function getConcurrentRequestsPerWebsite()
{
return $this->getParameterFromCli('--concurrent-requests-per-website', true);
$cliParam = $this->getParameterFromCli('--concurrent-requests-per-website', true);
if ($cliParam !== false) {
return $cliParam;
}
return self::MAX_CONCURRENT_API_REQUESTS;
}
}
......@@ -130,8 +130,8 @@ if(function_exists('parse_ini_file')) {
if(!file_exists($filename)) {
return false;
}
// Note: INI_SCANNER_RAW is important here!
return parse_ini_file($filename, $process_sections, INI_SCANNER_RAW);
return parse_ini_file($filename, $process_sections);
}
} else {
// we can't redefine parse_ini_file() if it has been disabled
......
......@@ -6,12 +6,11 @@ use Piwik\Config;
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
* @group Core
*/
class ConfigTest extends PHPUnit_Framework_TestCase
{
/**
* @group Core
*/
public function testUserConfigOverwritesSectionGlobalConfigValue()
{
$userFile = PIWIK_INCLUDE_PATH . '/tests/resources/Config/config.ini.php';
......@@ -41,9 +40,6 @@ class ConfigTest extends PHPUnit_Framework_TestCase
}
/**
* @group Core
*/
public function test_CommonConfig_Overrides()
{
$userFile = PIWIK_INCLUDE_PATH . '/tests/resources/Config/config.ini.php';
......@@ -60,9 +56,6 @@ class ConfigTest extends PHPUnit_Framework_TestCase
}
/**
* @group Core
*/
public function testWritingConfigWithSpecialCharacters()
{
$userFile = PIWIK_INCLUDE_PATH . '/tests/resources/Config/config.written.ini.php';
......@@ -92,9 +85,6 @@ class ConfigTest extends PHPUnit_Framework_TestCase
$this->assertEquals($stringWritten, $config->Category['test2']);
}
/**
* @group Core
*/
public function testUserConfigOverwritesGlobalConfig()
{
$userFile = PIWIK_PATH_TEST_TO_ROOT . '/tests/resources/Config/config.ini.php';
......@@ -154,8 +144,6 @@ class ConfigTest extends PHPUnit_Framework_TestCase
}
/**
* @group Core
*
* @dataProvider getCompareElementsData
*/
public function testCompareElements($description, $test)
......@@ -213,8 +201,6 @@ class ConfigTest extends PHPUnit_Framework_TestCase
}
/**
* @group Core
*
* @dataProvider getArrayUnmergeData
*/
public function testArrayUnmerge($description, $test)
......@@ -418,13 +404,22 @@ class ConfigTest extends PHPUnit_Framework_TestCase
'newSetting' => 'newValue')),
$header . "[General]\nkey = \"value\"\n\n[CommonCategory]\nnewSetting = \"newValue\"\n\n",
)),
array('Converts Dollar Sign To Dollar Entity', array(
array('General' => array('key' => '$value', 'key2' => '${value}')), // local
array('General' => array('key' => '$global'), // global
'CommonCategory' => array('settingGlobal' => 'valueGlobal')),
array('CommonCategory' => array('settingCommon' => 'common', // common
'settingCommon2' => 'common2')),
array('CommonCategory' => array('settingCommon2' => 'common2',
'newSetting' => 'newValue')),
$header . "[General]\nkey = \"$value\"\nkey2 = \"${value}\"\n\n[CommonCategory]\nnewSetting = \"newValue\"\n\n",
)),
);
}
/**
* @group Core
*
* @dataProvider getDumpConfigData
*/
public function testDumpConfig($description, $test)
......@@ -436,5 +431,18 @@ class ConfigTest extends PHPUnit_Framework_TestCase
$output = $config->dumpConfig($configLocal, $configGlobal, $configCommon, $configCache);
$this->assertEquals($expected, $output, $description);
}
public function testDollarEntityGetsConvertedToDollarSign()
{
$userFile = PIWIK_INCLUDE_PATH . '/tests/resources/Config/config.ini.php';
$globalFile = PIWIK_INCLUDE_PATH . '/tests/resources/Config/global.ini.php';
$commonFile = PIWIK_INCLUDE_PATH . '/tests/resources/Config/common.config.ini.php';
$config = Config::getInstance();
$config->setTestEnvironment($userFile, $globalFile, $commonFile);
$config->init();
$this->assertEquals('${@piwik(crash))}', $config->Category['key3']);
}
}
......@@ -7,6 +7,7 @@
*/
use Piwik\Option;
use Piwik\Http;
/**
* Tests to call the archive.php script via web and check there is no error,
......@@ -31,10 +32,8 @@ class Test_Piwik_Integration_ArchiveWebTest extends IntegrationTestCase
$urlTmp = Option::get('piwikUrl');
Option::set('piwikUrl', $host . 'tests/PHPUnit/proxy/index.php');
$streamContext = stream_context_create(array('http' => array('timeout' => 600)));
$url = $host . 'tests/PHPUnit/proxy/archive.php?token_auth=' . $token . '&forcelogtoscreen=1';
$output = file_get_contents($url, 0, $streamContext);
$output = Http::sendHttpRequest($url, 600);
// ignore random build issues
if (empty($output) || strpos($output, \Piwik\CronArchive::NO_ERROR) === false) {
......
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="true"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
backupGlobals="true"
backupStaticAttributes="false"
bootstrap="bootstrap.php"
colors="false"
......@@ -14,7 +16,6 @@
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
syntaxCheck="false"
strict="false"
verbose="true">
......
[Category]
key2 = valueCommon
; This should not trigger an error if INI_SCANNER_RAW is used
key3 = "${@piwik(crash))}"
key3 = "&#36;{@piwik(crash))}"
[GeneralSection]
password = passwordCommonShouldNotBeOverriden
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter