Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/PHPUnit/Framework/Fixture.php15
-rw-r--r--tests/PHPUnit/Framework/Mock/TestConfig.php11
-rw-r--r--tests/PHPUnit/System/ConsoleTest.php132
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml2
-rw-r--r--tests/PHPUnit/Unit/Archiver/RequestTest.php28
-rw-r--r--tests/UI/expected-screenshots/Comparison_segmented_visitorlog.png4
-rw-r--r--tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png4
-rw-r--r--tests/UI/expected-screenshots/OneClickUpdate_login.png4
-rw-r--r--tests/UI/expected-screenshots/Theme_home.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_ecommerce_log.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_ecommerce_log_segmented.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_segmented_visitorlog.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_visitor_profile_popup.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_visitors_realtime_map.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_visitors_software.png4
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_widgetize_ecommercelog.png4
m---------tests/travis0
18 files changed, 210 insertions, 26 deletions
diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php
index 88b057f4e1..1150444db3 100644
--- a/tests/PHPUnit/Framework/Fixture.php
+++ b/tests/PHPUnit/Framework/Fixture.php
@@ -15,6 +15,7 @@ use Piwik\Auth;
use Piwik\Auth\Password;
use Matomo\Cache\Backend\File;
use Piwik\Cache as PiwikCache;
+use Piwik\CliMulti\CliPhp;
use Piwik\Common;
use Piwik\Config;
use Piwik\Container\StaticContainer;
@@ -145,6 +146,20 @@ class Fixture extends \PHPUnit_Framework_Assert
return 'python';
}
+ public static function getCliCommandBase()
+ {
+ $cliPhp = new CliPhp();
+ $php = $cliPhp->findPhpBinary();
+
+ $command = $php . ' ' . PIWIK_INCLUDE_PATH .'/tests/PHPUnit/proxy/console ';
+
+ if (!empty($_SERVER['HTTP_HOST'])) {
+ $command .= '--matomo-domain=' . $_SERVER['HTTP_HOST'];
+ }
+
+ return $command;
+ }
+
public static function getTestRootUrl()
{
return self::getRootUrl() . 'tests/PHPUnit/proxy/';
diff --git a/tests/PHPUnit/Framework/Mock/TestConfig.php b/tests/PHPUnit/Framework/Mock/TestConfig.php
index 3676163e0d..7fe0302e11 100644
--- a/tests/PHPUnit/Framework/Mock/TestConfig.php
+++ b/tests/PHPUnit/Framework/Mock/TestConfig.php
@@ -58,9 +58,18 @@ class TestConfig extends Config
// Ensure local mods do not affect tests
if (empty($pathGlobal)) {
+ $general = $chain->getFrom($this->getLocalPath(), 'General');
+ $instanceId = isset($general['instance_id']) ? $general['instance_id'] : null;
+
$chain->set('Debug', $chain->getFrom($this->getGlobalPath(), 'Debug'));
$chain->set('mail', $chain->getFrom($this->getGlobalPath(), 'mail'));
- $chain->set('General', $chain->getFrom($this->getGlobalPath(), 'General'));
+
+ $globalGeneral = $chain->getFrom($this->getGlobalPath(), 'General');
+ if ($instanceId) {
+ $globalGeneral['instance_id'] = $instanceId;
+ }
+ $chain->set('General', $globalGeneral);
+
$chain->set('Segments', $chain->getFrom($this->getGlobalPath(), 'Segments'));
$chain->set('Tracker', $chain->getFrom($this->getGlobalPath(), 'Tracker'));
$chain->set('Deletelogs', $chain->getFrom($this->getGlobalPath(), 'Deletelogs'));
diff --git a/tests/PHPUnit/System/ConsoleTest.php b/tests/PHPUnit/System/ConsoleTest.php
index 939cfee6ac..9221fa8530 100644
--- a/tests/PHPUnit/System/ConsoleTest.php
+++ b/tests/PHPUnit/System/ConsoleTest.php
@@ -8,9 +8,13 @@
namespace Piwik\Tests\System;
+use Piwik\CliMulti\CliPhp;
+use Piwik\Config;
use Piwik\Container\StaticContainer;
+use Piwik\Development;
use Piwik\Plugin\ConsoleCommand;
use Piwik\Plugins\Monolog\Handler\FailureLogMessageDetector;
+use Piwik\Tests\Framework\Fixture;
use Psr\Log\LoggerInterface;
use Monolog\Logger;
use Symfony\Component\Console\Input\InputInterface;
@@ -51,6 +55,56 @@ class TestCommandWithError extends ConsoleCommand
}
}
+class TestCommandWithFatalError extends ConsoleCommand
+{
+ public function configure()
+ {
+ parent::configure();
+
+ $this->setName('test-command-with-fatal-error');
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ try {
+ \Piwik\ErrorHandler::pushFatalErrorBreadcrumb(static::class);
+
+ $this->executeImpl($input, $output);
+ } finally {
+ \Piwik\ErrorHandler::popFatalErrorBreadcrumb();
+ }
+ }
+
+ public function executeImpl(InputInterface $input, OutputInterface $output)
+ {
+ try {
+ \Piwik\ErrorHandler::pushFatalErrorBreadcrumb(static::class, []);
+
+ $val = "";
+ while (true) {
+ $val .= str_repeat("*", 1024 * 1024 * 1024);
+ }
+ } finally {
+ \Piwik\ErrorHandler::popFatalErrorBreadcrumb();
+ }
+ }
+}
+
+class TestCommandWithException extends ConsoleCommand
+{
+ public function configure()
+ {
+ parent::configure();
+
+ $this->setName('test-command-with-exception');
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ throw new \Exception('test error');
+ }
+}
+
class ConsoleTest extends ConsoleCommandTestCase
{
public function setUp()
@@ -89,12 +143,90 @@ class ConsoleTest extends ConsoleCommandTestCase
$this->assertEquals(0, $exitCode);
}
+ public function test_Console_handlesFatalErrorsCorrectly()
+ {
+ $command = Fixture::getCliCommandBase();
+ $command .= ' test-command-with-fatal-error';
+ $command .= ' 2>&1';
+
+ $output = shell_exec($command);
+ $output = $this->normalizeOutput($output);
+
+ $expected = <<<END
+#!/usr/bin/env php
+PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes) in /tests/PHPUnit/System/ConsoleTest.php on line 85
+
+Fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes) in /tests/PHPUnit/System/ConsoleTest.php on line 85
+*** IN SAFEMODE ***
+Matomo encountered an error: Allowed memory size of X bytes exhausted (tried to allocate X bytes) (which lead to: Error: array (
+ 'type' => 1,
+ 'message' => 'Allowed memory size of X bytes exhausted (tried to allocate X bytes)',
+ 'file' => '/tests/PHPUnit/System/ConsoleTest.php',
+ 'line' => 85,
+ 'backtrace' => ' on /tests/PHPUnit/System/ConsoleTest.php(85)
+#0 /tests/PHPUnit/System/ConsoleTest.php(72): Piwik\\\\Tests\\\\System\\\\TestCommandWithFatalError->executeImpl()
+#1 /vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\\\\Tests\\\\System\\\\TestCommandWithFatalError->execute()
+',
+))
+END;
+
+ $this->assertEquals($expected, $output);
+ }
+
+ public function test_Console_handlesExceptionsCorrectly()
+ {
+ $command = Fixture::getCliCommandBase();
+ $command .= ' test-command-with-exception';
+ $command .= ' 2>&1';
+
+ $output = shell_exec($command);
+ $output = $this->normalizeOutput($output);
+
+ $expected = <<<END
+#!/usr/bin/env php
+*** IN SAFEMODE ***
+
+
+
+ [Exception]
+ test error
+
+
+
+test-command-with-exception
+
+
+
+END;
+ $this->assertEquals($expected, $output);
+ }
+
public static function provideContainerConfigBeforeClass()
{
return [
'log.handlers' => [\DI\get(FailureLogMessageDetector::class)],
LoggerInterface::class => \DI\object(Logger::class)
->constructor('piwik', \DI\get('log.handlers'), \DI\get('log.processors')),
+
+ 'observers.global' => \DI\add([
+ ['Console.filterCommands', function (&$commands) {
+ $commands[] = TestCommandWithFatalError::class;
+ $commands[] = TestCommandWithException::class;
+ }],
+
+ ['Request.dispatch', function ($module, $action) {
+ if ($module === 'CorePluginsAdmin' && $action === 'safemode') {
+ print "*** IN SAFEMODE ***\n"; // will appear in output
+ }
+ }],
+ ]),
];
}
+
+ private function normalizeOutput($output)
+ {
+ $output = str_replace(PIWIK_INCLUDE_PATH, '', $output);
+ $output = preg_replace('/[0-9]+ bytes/', 'X bytes', $output);
+ return $output;
+ }
} \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
index effff1c382..d3d5264cab 100644
--- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
@@ -106,7 +106,7 @@
<category>Visitors</category>
<name>Device brand</name>
<segment>deviceBrand</segment>
- <acceptedValues>3Q, 4Good, Acer, Advan, Advance, AGM, Ainol, Airness, Airties, AIS, Aiwa, Akai, Alba, Alcatel, AllCall, Allview, Allwinner, Altech UEC, altron, Amazon, AMGOO, Amoi, ANS, Apple, Archos, Arian Space, Ark, Arnova, ARRIS, Ask, Assistant, Asus, Audiovox, AVH, Avvio, Axxion, Azumi Mobile, BangOlufsen, Barnes &amp; Noble, BBK, BDF, Becker, Beeline, Beetel, BenQ, BenQ-Siemens, BGH, Bird, Bitel, Black Fox, Blackview, Blaupunkt, Blu, Bluboo, Bluegood, Bmobile, bogo, Boway, bq, Bravis, Brondi, Bush, CAGI, Capitel, Captiva, Carrefour, Casio, Casper, Cat, Celkon, Changhong, Cherry Mobile, China Mobile, Clarmin, CnM, Coby Kyros, Comio, Compal, Compaq, ComTrade Tesla, Concord, ConCorde, Condor, Coolpad, Cowon, CreNova, Crescent, Cricket, Crius Mea, Crosscall, Cube, CUBOT, CVTE, Cyrus, Danew, Datang, Datsun, Dbtel, Dell, Denver, Desay, DEXP, Dialog, Dicam, Digi, Digicel, Digiland, Digma, DMM, DNS, DoCoMo, Doogee, Doov, Dopod, Doro, Dune HD, E-Boda, E-tel, Easypix, EBEST, Echo Mobiles, ECS, EE, EKO, Eks Mobility, Elenberg, Elephone, Energizer, Energy Sistem, Ergo, Ericsson, Ericy, Essential, Essentielb, Eton, eTouch, Etuline, Eurostar, Evercoss, Evertek, Evolio, Evolveo, EvroMedia, Explay, Extrem, Ezio, Ezze, Fairphone, Famoco, Fengxiang, FiGO, FinePower, Fly, FNB, Fondi, FORME, Forstar, Foxconn, Freetel, Fujitsu, G-TiDE, Garmin-Asus, Gateway, Gemini, General Mobile, Geotel, Ghia, Gigabyte, Gigaset, Ginzzu, Gionee, GOCLEVER, Goly, GoMobile, Google, Gradiente, Grape, Grundig, Hafury, Haier, HannSpree, Hasee, Hi-Level, Highscreen, Hisense, Hoffmann, Homtom, Hoozo, Hosin, HP, HTC, Huawei, Humax, Hyrican, Hyundai, i-Joy, i-mate, i-mobile, iBall, iBerry, IconBIT, iHunt, Ikea, iKoMo, iLA, IMO Mobile, Impression, iNew, Infinix, InFocus, Inkti, InnJoo, Innostream, Inoi, INQ, Insignia, Intek, Intex, Inverto, iOcean, iPro, Irbis, iRola, iTel, iView, iZotron, JAY-Tech, Jiayu, Jolla, Just5, K-Touch, Kaan, Kalley, Karbonn, Kazam, KDDI, Kempler &amp; Strauss, Keneksi, Kiano, Kingsun, Kocaso, Kodak, Kogan, Komu, Konka, Konrow, Koobee, KOPO, Koridy, KRONO, Krüger&amp;Matz, KT-Tech, Kumai, Kyocera, LAIQ, Land Rover, Landvo, Lanix, Lark, Lava, LCT, Leagoo, Ledstar, LeEco, Lemhoov, Lenco, Lenovo, Leotec, Le Pan, Lephone, Lexand, Lexibook, LG, Lingwin, Loewe, Logicom, Lumus, LYF, M.T.T., M4tel, Majestic, Manta Multimedia, Masstel, Maxwest, Maze, Mecer, Mecool, Mediacom, MediaTek, Medion, MEEG, MegaFon, Meitu, Meizu, Memup, Metz, MEU, MicroMax, Microsoft, Mio, Miray, Mitsubishi, MIXC, MLLED, Mobicel, Mobiistar, Mobiola, Mobistel, Modecom, Mofut, Motorola, Movic, Mpman, MSI, MTC, MTN, MYFON, MyPhone, Myria, MyWigo, Navon, NEC, Neffos, Netgear, NeuImage, Newgen, NEXBOX, Nexian, Nextbit, NextBook, NGM, Nikon, Nintendo, NOA, Noain, Nobby, Noblex, Nokia, Nomi, Nous, NUU Mobile, Nvidia, NYX Mobile, O+, O2, Obi, Odys, Onda, OnePlus, OPPO, Opsson, Orange, Ouki, OUYA, Overmax, Oysters, Palm, Panacom, Panasonic, Pantech, PCBOX, PCD, PCD Argentina, PEAQ, Pentagram, Philips, phoneOne, Pioneer, Pixus, Ployer, Plum, Point of View, Polaroid, PolyPad, Polytron, Pomp, Positivo, PPTV, Prestigio, Primepad, ProScan, PULID, Q-Touch, Qilive, QMobile, Qtek, Quantum, Quechua, R-TV, Ramos, RCA Tablets, Readboy, Rikomagic, RIM, Rinno, Ritmix, Riviera, Roadrover, Rokit, Roku, Rombica, Ross&amp;Moor, Rover, RoverPad, RT Project, Safaricom, Sagem, Samsung, Sanei, Santin BiTBiZ, Sanyo, Savio, Sega, Selevision, Selfix, Sencor, Sendo, Senseit, Senwa, SFR, Sharp, Shuttle, Siemens, Sigma, Silent Circle, Simbans, Sky, Skyworth, Smart, Smartfren, Smartisan, Softbank, Sonim, Sony, Sony Ericsson, Spice, Star, Starway, STF Mobile, STK, Stonex, Storex, Sumvision, SunVan, SuperSonic, Supra, SWISSMOBILITY, Symphony, Syrox, T-Mobile, TB Touch, TCL, TechniSat, TechnoTrend, TechPad, Teclast, Tecno Mobile, Telefunken, Telego, Telenor, Telit, Tesco, Tesla, teXet, ThL, Thomson, TIANYU, Timovi, TiPhone, Tolino, Tooky, Top House, Toplux, Toshiba, Touchmate, TrekStor, Trevi, True, Tunisie Telecom, Turbo, Turbo-X, TVC, U.S. Cellular, Uhappy, Ulefone, UMIDIGI, Unimax, Uniscope, Unknown, Unnecto, Unonu, Unowhy, UTOK, UTStarcom, Vastking, Venso, Verizon, Vernee, Vertex, Vertu, Verykool, Vestel, VGO TEL, Videocon, Videoweb, ViewSonic, Vinsoc, Vitelcom, Vivax, Vivo, Vizio, VK Mobile, Vodafone, Vonino, Vorago, Voto, Voxtel, Vulcan, Walton, Web TV, Weimei, WellcoM, Wexler, Wiko, Wileyfox, Wink, Wolder, Wolfgang, Wonu, Woo, Woxter, X-TIGI, X-View, Xiaolajiao, Xiaomi, Xion, Xolo, Yandex, Yarvik, Yes, Yezz, Ytone, Yu, Yuandao, Yusun, Zeemi, Zen, Zenek, Zonda, Zopo, ZTE, Zuum, Zync, ZYQ, öwn</acceptedValues>
+ <acceptedValues>3Q, 4Good, Acer, Advan, Advance, AGM, Ainol, Airness, Airties, AIS, Aiwa, Akai, Alba, Alcatel, AllCall, Allview, Allwinner, Altech UEC, altron, Amazon, AMGOO, Amoi, ANS, Apple, Archos, Arian Space, Ark, Arnova, ARRIS, Ask, Assistant, Asus, Audiovox, AVH, Avvio, Axxion, Azumi Mobile, BangOlufsen, Barnes &amp; Noble, BBK, BDF, Becker, Beeline, Beetel, BenQ, BenQ-Siemens, BGH, Bird, Bitel, Black Fox, Blackview, Blaupunkt, Blu, Bluboo, Bluegood, Bmobile, bogo, Boway, bq, Bravis, Brondi, Bush, CAGI, Capitel, Captiva, Carrefour, Casio, Casper, Cat, Celkon, Changhong, Cherry Mobile, China Mobile, Clarmin, CnM, Coby Kyros, Comio, Compal, Compaq, ComTrade Tesla, Concord, ConCorde, Condor, Coolpad, Cowon, CreNova, Crescent, Cricket, Crius Mea, Crosscall, Cube, CUBOT, CVTE, Cyrus, Danew, Datang, Datsun, Dbtel, Dell, Denver, Desay, DEXP, Dialog, Dicam, Digi, Digicel, Digiland, Digma, DMM, DNS, DoCoMo, Doogee, Doov, Dopod, Doro, Dune HD, E-Boda, E-tel, Easypix, EBEST, Echo Mobiles, ECS, EE, EKO, Eks Mobility, Elenberg, Elephone, Energizer, Energy Sistem, Ergo, Ericsson, Ericy, Essential, Essentielb, Eton, eTouch, Etuline, Eurostar, Evercoss, Evertek, Evolio, Evolveo, EvroMedia, Explay, Extrem, Ezio, Ezze, Fairphone, Famoco, Fengxiang, FiGO, FinePower, Fly, FNB, Fondi, FORME, Forstar, Foxconn, Freetel, Fujitsu, G-TiDE, Garmin-Asus, Gateway, Gemini, General Mobile, Geotel, Ghia, Gigabyte, Gigaset, Ginzzu, Gionee, GOCLEVER, Goly, GoMobile, Google, Gradiente, Grape, Grundig, Hafury, Haier, HannSpree, Hasee, Hi-Level, Highscreen, Hisense, Hoffmann, Homtom, Hoozo, Hosin, HP, HTC, Huawei, Humax, Hyrican, Hyundai, i-Joy, i-mate, i-mobile, iBall, iBerry, IconBIT, iHunt, Ikea, iKoMo, iLA, IMO Mobile, Impression, iNew, Infinix, InFocus, Inkti, InnJoo, Innostream, Inoi, INQ, Insignia, Intek, Intex, Inverto, iOcean, iPro, Irbis, iRola, iTel, iView, iZotron, JAY-Tech, Jiayu, Jolla, Just5, K-Touch, Kaan, Kalley, Karbonn, Kazam, KDDI, Kempler &amp; Strauss, Keneksi, Kiano, Kingsun, Kocaso, Kodak, Kogan, Komu, Konka, Konrow, Koobee, KOPO, Koridy, KRONO, Krüger&amp;Matz, KT-Tech, Kumai, Kyocera, LAIQ, Land Rover, Landvo, Lanix, Lark, Lava, LCT, Leagoo, Ledstar, LeEco, Lemhoov, Lenco, Lenovo, Leotec, Le Pan, Lephone, Lexand, Lexibook, LG, Lingwin, Loewe, Logicom, Lumus, LYF, M.T.T., M4tel, Majestic, Manta Multimedia, Masstel, Maxwest, Maze, Mecer, Mecool, Mediacom, MediaTek, Medion, MEEG, MegaFon, Meitu, Meizu, Memup, Metz, MEU, MicroMax, Microsoft, Mio, Miray, Mitsubishi, MIXC, MLLED, Mobicel, Mobiistar, Mobiola, Mobistel, Modecom, Mofut, Motorola, Movic, Mpman, MSI, MTC, MTN, MYFON, MyPhone, Myria, MyWigo, Navon, NEC, Neffos, Netgear, NeuImage, Newgen, NEXBOX, Nexian, Nextbit, NextBook, NGM, Nikon, Nintendo, NOA, Noain, Nobby, Noblex, Nokia, Nomi, Nous, NUU Mobile, Nvidia, NYX Mobile, O+, O2, Obi, Odys, Onda, OnePlus, OPPO, Opsson, Orange, Ordissimo, Ouki, OUYA, Overmax, Oysters, Palm, Panacom, Panasonic, Pantech, PCBOX, PCD, PCD Argentina, PEAQ, Pentagram, Philips, phoneOne, Pioneer, Pixus, Ployer, Plum, Point of View, Polaroid, PolyPad, Polytron, Pomp, Positivo, PPTV, Prestigio, Primepad, ProScan, PULID, Q-Touch, Qilive, QMobile, Qtek, Quantum, Quechua, R-TV, Ramos, RCA Tablets, Readboy, Rikomagic, RIM, Rinno, Ritmix, Riviera, Roadrover, Rokit, Roku, Rombica, Ross&amp;Moor, Rover, RoverPad, RT Project, Safaricom, Sagem, Samsung, Sanei, Santin BiTBiZ, Sanyo, Savio, Sega, Selevision, Selfix, Sencor, Sendo, Senseit, Senwa, SFR, Sharp, Shuttle, Siemens, Sigma, Silent Circle, Simbans, Sky, Skyworth, Smart, Smartfren, Smartisan, Softbank, Sonim, Sony, Sony Ericsson, Spice, Star, Starway, STF Mobile, STK, Stonex, Storex, Sumvision, SunVan, SuperSonic, Supra, SWISSMOBILITY, Symphony, Syrox, T-Mobile, TB Touch, TCL, TechniSat, TechnoTrend, TechPad, Teclast, Tecno Mobile, Telefunken, Telego, Telenor, Telit, Tesco, Tesla, teXet, ThL, Thomson, TIANYU, Timovi, TiPhone, Tolino, Tooky, Top House, Toplux, Toshiba, Touchmate, TrekStor, Trevi, True, Tunisie Telecom, Turbo, Turbo-X, TVC, U.S. Cellular, Uhappy, Ulefone, UMIDIGI, Unimax, Uniscope, Unknown, Unnecto, Unonu, Unowhy, UTOK, UTStarcom, Vastking, Venso, Verizon, Vernee, Vertex, Vertu, Verykool, Vestel, VGO TEL, Videocon, Videoweb, ViewSonic, Vinsoc, Vitelcom, Vivax, Vivo, Vizio, VK Mobile, Vodafone, Vonino, Vorago, Voto, Voxtel, Vulcan, Walton, Web TV, Weimei, WellcoM, Wexler, Wiko, Wileyfox, Wink, Wolder, Wolfgang, Wonu, Woo, Woxter, X-TIGI, X-View, Xiaolajiao, Xiaomi, Xion, Xolo, Yandex, Yarvik, Yes, Yezz, Ytone, Yu, Yuandao, Yusun, Zeemi, Zen, Zenek, Zonda, Zopo, ZTE, Zuum, Zync, ZYQ, öwn</acceptedValues>
</row>
<row>
<type>dimension</type>
diff --git a/tests/PHPUnit/Unit/Archiver/RequestTest.php b/tests/PHPUnit/Unit/Archiver/RequestTest.php
index ae168023c2..6ae658e10b 100644
--- a/tests/PHPUnit/Unit/Archiver/RequestTest.php
+++ b/tests/PHPUnit/Unit/Archiver/RequestTest.php
@@ -11,9 +11,16 @@ namespace Piwik\Tests\Unit\Archiver;
use Piwik\Archiver\Request;
+use Piwik\Date;
class RequestTest extends \PHPUnit_Framework_TestCase
{
+ protected function tearDown()
+ {
+ parent::tearDown();
+ Date::$now = null;
+ }
+
/**
* @dataProvider getTestDataForChangeDate
*/
@@ -44,4 +51,25 @@ class RequestTest extends \PHPUnit_Framework_TestCase
],
];
}
+
+ /**
+ * @dataProvider getTestDataForMakeSureDateIsNotSingleDayRange
+ */
+ public function test_makeSureDateIsNotSingleDayRange($url, $expectedResult)
+ {
+ $request = new Request($url);
+ $request->makeSureDateIsNotSingleDayRange();
+ $this->assertEquals($expectedResult, $request->getUrl());
+ }
+
+ public function getTestDataForMakeSureDateIsNotSingleDayRange()
+ {
+ return [
+ ['?idSite=1&date=2012-03-04&period=day', '?idSite=1&date=2012-03-04&period=day'],
+ ['?idSite=1&date=2012-03-04,2012-03-06&period=range', '?idSite=1&date=2012-03-04,2012-03-06&period=range'],
+ ['?idSite=1&date=2012-03-04,2012-03-04&period=range', '?idSite=1&date=2012-03-04&period=day'],
+ ['?idSite=1&date=last1&period=range', '?idSite=1&date=today&period=day'],
+ ['?idSite=1&date=previous1&period=range', '?idSite=1&date=yesterday&period=day'],
+ ];
+ }
} \ No newline at end of file
diff --git a/tests/UI/expected-screenshots/Comparison_segmented_visitorlog.png b/tests/UI/expected-screenshots/Comparison_segmented_visitorlog.png
index 70a7be1660..0143bbd3e6 100644
--- a/tests/UI/expected-screenshots/Comparison_segmented_visitorlog.png
+++ b/tests/UI/expected-screenshots/Comparison_segmented_visitorlog.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:9b42b527f2c040b7d8a799f2911d4106ea7d45c4445492ba01c5612e96e1d1a5
-size 402405
+oid sha256:a2c444a6346d473478d736bf795daa423f63c8b4b117d24143b295bb5b7433e6
+size 402422
diff --git a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png
index 398f1992d8..364c635978 100644
--- a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png
+++ b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:5659a10d7a765d14695f644d0f261ec48e3837b4e2d76cf4adc35cf201a47b48
-size 299416
+oid sha256:955f729afa61f6602b09e45da4535de8e64608cc7a4f14229a1fd4992f88e88f
+size 300129
diff --git a/tests/UI/expected-screenshots/OneClickUpdate_login.png b/tests/UI/expected-screenshots/OneClickUpdate_login.png
index 8ffded54d4..c0f41534c3 100644
--- a/tests/UI/expected-screenshots/OneClickUpdate_login.png
+++ b/tests/UI/expected-screenshots/OneClickUpdate_login.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:63cfae7c2afcafca1d96340384b829f817219e36dbd6d89fca81a0079f71610f
-size 244652
+oid sha256:1053964b638aff9107e69cd0d465a0a72799f3ea9db8884df3117c6d42efc830
+size 268010
diff --git a/tests/UI/expected-screenshots/Theme_home.png b/tests/UI/expected-screenshots/Theme_home.png
index cbb3613d0c..548efd6092 100644
--- a/tests/UI/expected-screenshots/Theme_home.png
+++ b/tests/UI/expected-screenshots/Theme_home.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:78d41258eee99c5fe3afeecada66a2bd6c6b386684aaefa87ed6dc03e21cf643
-size 708602
+oid sha256:07a3d8e06179049407d8089499fce1e6c45c7622755bf411dba01680774486ef
+size 708620
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png
index ccfa9ab4e7..5e2f22458d 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:4060bac4f42231b58dce665c64998e9886cd6d5175ee9c4692080b8cdd23ddae
-size 632336
+oid sha256:c2490d9349b38b65962458e6344b767ae32c3adbf3e7f040a367035d82c845fd
+size 632381
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_ecommerce_log.png b/tests/UI/expected-screenshots/UIIntegrationTest_ecommerce_log.png
index f565793aaf..4329757954 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_ecommerce_log.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_ecommerce_log.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:7bed358956b83d163cd6b6a50add25d343479caecfc63f1752f45bce31af0a2f
-size 499249
+oid sha256:4bb7d263038ade7d53af8cda07d482efef3dc741626380832f112de561bab741
+size 499294
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_ecommerce_log_segmented.png b/tests/UI/expected-screenshots/UIIntegrationTest_ecommerce_log_segmented.png
index 779c8f836f..e2b9cf6263 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_ecommerce_log_segmented.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_ecommerce_log_segmented.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:c1f826eac0237f8447bbea06cb8b0fb092adaf6007eddcb4c39bd477de4ee581
-size 61880
+oid sha256:84a67bdeb17c8b0fdad09f9170bdebb5f3325c2d459ebfcd35fcc648fc5e5552
+size 61896
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_segmented_visitorlog.png b/tests/UI/expected-screenshots/UIIntegrationTest_segmented_visitorlog.png
index b13791984c..f3d5270ff6 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_segmented_visitorlog.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_segmented_visitorlog.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:292a885028edf409c1e20af41e3e54bed24c21a6cbf0118885e083a8fb63a7b7
-size 379446
+oid sha256:1b7ca48581626674bef127e465760e2fe5d22a85801ff7d96bdaeddaf3d33ee1
+size 379471
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_visitor_profile_popup.png b/tests/UI/expected-screenshots/UIIntegrationTest_visitor_profile_popup.png
index 2672fb78e1..41a8af6fb6 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_visitor_profile_popup.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_visitor_profile_popup.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:b8d15df1c59ece6e63a11886d934de599a6625fca9a0edc3c0ba55e6675e65e8
-size 184786
+oid sha256:bd66aa14cc29d4917ac5bbcda1ae99aaeac188d485b22d944c8eca55666cb0c5
+size 184802
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_visitors_realtime_map.png b/tests/UI/expected-screenshots/UIIntegrationTest_visitors_realtime_map.png
index 8c1a283cf5..d79dd14d58 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_visitors_realtime_map.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_visitors_realtime_map.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e152f24cce664e5919939e0e1433a32ac7a54274c66d51d6f448f31af91007cb
-size 117081
+oid sha256:03ee5b90fbcda06971f51a13115882df782af7a5dda0a74ab0824f3d897bb75d
+size 117095
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_visitors_software.png b/tests/UI/expected-screenshots/UIIntegrationTest_visitors_software.png
index ec35942247..595620a5a6 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_visitors_software.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_visitors_software.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d48a483dec59934bbc464b46e6e9d32a7bfed6ecfdefe9e5a85c868b331211a8
-size 152916
+oid sha256:44eaebc5b4514b58019679140201ec2f1ea34295ae0a994164de98096a94723b
+size 152925
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_widgetize_ecommercelog.png b/tests/UI/expected-screenshots/UIIntegrationTest_widgetize_ecommercelog.png
index 8c0c0cd66f..d17add0934 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_widgetize_ecommercelog.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_widgetize_ecommercelog.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:96dcb392d7faef30bad0c5a48f13b4eea7529e887af3d9fe136a83c1acd5f0c0
-size 485504
+oid sha256:64cd903c8e7c86e364bc239022d2cf0a669ba8d69f87ebf92d38849b4b7745be
+size 485536
diff --git a/tests/travis b/tests/travis
-Subproject 74e0a7b6902f6799f3647b0f29638158d3b1116
+Subproject f215e0066c4ea0c45cceaee3ed6a06fc623ebaf