diff --git a/.travis.yml b/.travis.yml index 4eb7e54becf74b11deea538c14f06bc33ce5be38..25286e1e149e9d313385b7de5fe156ec0c2aab82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,8 +87,8 @@ before_script: - mysql -e "SHOW GLOBAL VARIABLES;" # Setup Piwik stack - ./tests/travis/initiate_ui_tests.sh - - composer self-update - - composer install + - travis_retry composer self-update + - travis_retry composer install - uname -a - date - php -r "var_dump(gd_info());" diff --git a/LEGALNOTICE b/LEGALNOTICE index f6ad6267c96a23218915dd8d2b56d7855712eb9b..93c2f03493f95cc09bb9a3b9533b31036e90d8b2 100644 --- a/LEGALNOTICE +++ b/LEGALNOTICE @@ -40,7 +40,7 @@ CREDITS For detailed contribution history, refer to the source, tickets, patches, and Git revision history, available at - http://dev.piwik.org/trac/ + https://github.com/piwik/piwik/issues https://github.com/piwik/piwik diff --git a/composer.json b/composer.json index 61397de41147fcd199e38c3eb0cea8779496ca07..ada86611922be463cd51d8e892c831a1fcedfad2 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ ], "support": { "forum": "http://forum.piwik.org/", - "issues": "http://dev.piwik.org/trac/roadmap", + "issues": "https://github.com/piwik/piwik/issues", "wiki": "http://dev.piwik.org/", "source": "https://github.com/piwik/piwik" }, diff --git a/config/global.ini.php b/config/global.ini.php index 51dbba90cb8a2b839c6769af9ba2dcf31bcd2c8f..19fbef68bc0b5f524c03b12bf8b5f50749c5a2d1 100644 --- a/config/global.ini.php +++ b/config/global.ini.php @@ -548,7 +548,7 @@ bulk_requests_use_transaction = 1 ; Comma separated list of known Referrer Spammers, ie. bot visits that set a fake Referrer field. ; All Visits with a Referrer URL host set to one of these will be excluded. -; If you find new spam entries in Referrers>Websites, please report them here: http://dev.piwik.org/trac/ticket/5099 +; If you find new spam entries in Referrers>Websites, please report them here: https://github.com/piwik/piwik/issues/5099 referrer_urls_spam = "semalt.com" ; DO NOT USE THIS SETTING ON PUBLICLY AVAILABLE PIWIK SERVER diff --git a/core/API/DataTableGenericFilter.php b/core/API/DataTableGenericFilter.php index 6db2f2b476362da8a1cda6967b736035f3b34985..2d43f67b514279e87d87c65dbc3307ed1a281df5 100644 --- a/core/API/DataTableGenericFilter.php +++ b/core/API/DataTableGenericFilter.php @@ -15,6 +15,13 @@ use Piwik\DataTable; class DataTableGenericFilter { + /** + * List of filter names not to run. + * + * @var string[] + */ + private $disabledFilters = array(); + /** * Constructor * @@ -35,6 +42,16 @@ class DataTableGenericFilter $this->applyGenericFilters($table); } + /** + * Makes sure a set of filters are not run. + * + * @param string[] $filterNames The name of each filter to disable. + */ + public function disableFilters($filterNames) + { + $this->disabledFilters = array_unique(array_merge($this->disabledFilters, $filterNames)); + } + /** * Returns an array containing the information of the generic Filter * to be applied automatically to the data resulting from the API calls. @@ -117,6 +134,11 @@ class DataTableGenericFilter $filterParams = $filterMeta[1]; $filterParameters = array(); $exceptionRaised = false; + + if (in_array($filterName, $this->disabledFilters)) { + continue; + } + foreach ($filterParams as $name => $info) { // parameter type to cast to $type = $info[0]; diff --git a/core/API/DataTableManipulator/LabelFilter.php b/core/API/DataTableManipulator/LabelFilter.php index 3c50e67ff2960ed227242fde20e2c7e5f4a169b9..cd8300991bfbb875ebb71747281450d17838fb59 100644 --- a/core/API/DataTableManipulator/LabelFilter.php +++ b/core/API/DataTableManipulator/LabelFilter.php @@ -24,6 +24,7 @@ use Piwik\DataTable\Row; class LabelFilter extends DataTableManipulator { const SEPARATOR_RECURSIVE_LABEL = '>'; + const TERMINAL_OPERATOR = '@'; private $labels; private $addLabelIndex; @@ -118,9 +119,15 @@ class LabelFilter extends DataTableManipulator { static $pageTitleReports = array('getPageTitles', 'getEntryPageTitles', 'getExitPageTitles'); + $originalLabel = trim($originalLabel); + + $isTerminal = substr($originalLabel, 0, 1) == self::TERMINAL_OPERATOR; + if ($isTerminal) { + $originalLabel = substr($originalLabel, 1); + } + $variations = array(); - $label = urldecode($originalLabel); - $label = trim($label); + $label = trim(urldecode($originalLabel)); $sanitizedLabel = Common::sanitizeInputValue($label); $variations[] = $sanitizedLabel; @@ -128,9 +135,7 @@ class LabelFilter extends DataTableManipulator if ($this->apiModule == 'Actions' && in_array($this->apiMethod, $pageTitleReports) ) { - // temporary workaround for #4363, if a '%20' is at the end of this label, we assume it is a - // terminal label and only check for a terminal row. - if (substr($originalLabel, -3) == '%20') { + if ($isTerminal) { array_unshift($variations, ' ' . $sanitizedLabel); array_unshift($variations, ' ' . $label); } else { diff --git a/core/API/ResponseBuilder.php b/core/API/ResponseBuilder.php index 63d3f8f728f4f9b4788a219329a16f00c1a992df..bb387765ad2055d0404237872aba62ed7c368b2d 100644 --- a/core/API/ResponseBuilder.php +++ b/core/API/ResponseBuilder.php @@ -295,6 +295,9 @@ class ResponseBuilder */ protected function handleDataTable($datatable) { + // process request + $label = $this->getLabelFromRequest($this->request); + // if requested, flatten nested tables if (Common::getRequestVar('flat', '0', 'string', $this->request) == '1') { $flattener = new Flattener($this->apiModule, $this->apiMethod, $this->request); @@ -312,6 +315,10 @@ class ResponseBuilder // if the flag disable_generic_filters is defined we skip the generic filters if (0 == Common::getRequestVar('disable_generic_filters', '0', 'string', $this->request)) { $genericFilter = new DataTableGenericFilter($this->request); + if (!empty($label)) { + $genericFilter->disableFilters(array('Limit', 'Truncate')); + } + $genericFilter->filter($datatable); } @@ -332,7 +339,6 @@ class ResponseBuilder } // apply label filter: only return rows matching the label parameter (more than one if more than one label) - $label = $this->getLabelFromRequest($this->request); if (!empty($label)) { $addLabelIndex = Common::getRequestVar('labelFilterAddLabelIndex', 0, 'int', $this->request) == 1; diff --git a/core/ArchiveProcessor.php b/core/ArchiveProcessor.php index c15ea5dd54a7a5512eacac6278b45be5a0fbde54..10374f18c47a737e4a08196b27d25ad721e70708 100644 --- a/core/ArchiveProcessor.php +++ b/core/ArchiveProcessor.php @@ -337,7 +337,7 @@ class ArchiveProcessor } if ($dataTable instanceof Map) { - // see http://dev.piwik.org/trac/ticket/4377 + // see https://github.com/piwik/piwik/issues/4377 $self = $this; $dataTable->filter(function ($table) use ($self, $columnsToRenameAfterAggregation) { $self->renameColumnsAfterAggregation($table, $columnsToRenameAfterAggregation); diff --git a/core/Common.php b/core/Common.php index 64bf6926a1c3e4d004d439a43522167fcdfa0f3f..7ac908ad1e12c16e2ce13ba97501cd37d98f7a31 100644 --- a/core/Common.php +++ b/core/Common.php @@ -1066,7 +1066,7 @@ class Common /** * Marks an orphaned object for garbage collection. * - * For more information: {@link http://dev.piwik.org/trac/ticket/374} + * For more information: {@link https://github.com/piwik/piwik/issues/374} * @param $var The object to destroy. * @api */ diff --git a/core/CronArchive.php b/core/CronArchive.php index 7ca9389f85c734837d6354cc1b6700c2150cddfa..86d5bd4cffa80c0063c11de941b58f07e497e2f5 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -12,6 +12,7 @@ use Exception; use Piwik\ArchiveProcessor\Rules; use Piwik\CronArchive\FixedSiteIds; use Piwik\CronArchive\SharedSiteIds; +use Piwik\Period\Factory; use Piwik\Plugins\CoreAdminHome\API as APICoreAdminHome; use Piwik\Plugins\SitesManager\API as APISitesManager; @@ -1256,6 +1257,7 @@ class CronArchive $restrictToPeriods = explode(',', $restrictToPeriods); $restrictToPeriods = array_map('trim', $restrictToPeriods); $restrictToPeriods = array_intersect($restrictToPeriods, $this->getDefaultPeriodsToProcess()); + $restrictToPeriods = array_intersect($restrictToPeriods, Factory::getPeriodsEnabledForAPI()); return $restrictToPeriods; } diff --git a/core/DataAccess/ArchiveWriter.php b/core/DataAccess/ArchiveWriter.php index ad51698d83c7266d286b7604976d9d96f6d87353..f4c84248554babc860ad7ed5b8b9b96701a71f81 100644 --- a/core/DataAccess/ArchiveWriter.php +++ b/core/DataAccess/ArchiveWriter.php @@ -266,7 +266,7 @@ class ArchiveWriter $tableName = $this->getTableNameToInsert($value); - // duplicate idarchives are Ignored, see http://dev.piwik.org/trac/ticket/987 + // duplicate idarchives are Ignored, see https://github.com/piwik/piwik/issues/987 $query = "INSERT IGNORE INTO " . $tableName . " (" . implode(", ", $this->getInsertFields()) . ") VALUES (?,?,?,?,?,?,?,?)"; diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php index 80356c17946d453e6e14d7b8967ebfb459864741..76c7f17ce72ec2fac0a927796f0d986d38056dea 100644 --- a/core/Db/Schema/Mysql.php +++ b/core/Db/Schema/Mysql.php @@ -408,7 +408,7 @@ class Mysql implements SchemaInterface Db::exec($statement); } catch (Exception $e) { // mysql code error 1050:table already exists - // see bug #153 http://dev.piwik.org/trac/ticket/153 + // see bug #153 https://github.com/piwik/piwik/issues/153 if (!Db::get()->isErrNo($e, '1050')) { throw $e; } diff --git a/core/Log.php b/core/Log.php index 5dc22d37c2d8ce6d92b13adb87548283074a1862..a28032be9bb6646c274c160668424610313fdf35 100644 --- a/core/Log.php +++ b/core/Log.php @@ -386,9 +386,11 @@ class Log extends Singleton return; } - if(!file_put_contents($this->logToFilePath, $message, FILE_APPEND)) { + if (!@file_put_contents($this->logToFilePath, $message, FILE_APPEND) + && !defined('PIWIK_TEST_MODE') + ) { $message = Filechecks::getErrorMessageMissingPermissions($this->logToFilePath); - throw new \Exception( $message ); + throw new \Exception($message); } } diff --git a/core/Period/Factory.php b/core/Period/Factory.php index 11d5203ab728ee4858ceae2389a8d0cfa6f334b1..4b3f899002e0466bb6a48a9b8bb7a1482a54d042 100644 --- a/core/Period/Factory.php +++ b/core/Period/Factory.php @@ -125,7 +125,7 @@ class Factory /** * @return array */ - private static function getPeriodsEnabledForAPI() + public static function getPeriodsEnabledForAPI() { $enabledPeriodsInAPI = Config::getInstance()->General['enabled_periods_API']; $enabledPeriodsInAPI = explode(",", $enabledPeriodsInAPI); diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php index 0212a3769c74db7f39d401d4f3e9fb65057c994f..a8e9b7b1dd38f6a1395a143fae56029a3ced36b7 100644 --- a/core/Plugin/ControllerAdmin.php +++ b/core/Plugin/ControllerAdmin.php @@ -102,7 +102,7 @@ abstract class ControllerAdmin extends Controller } /** - * See http://dev.piwik.org/trac/ticket/4439#comment:8 and https://github.com/eaccelerator/eaccelerator/issues/12 + * See https://github.com/piwik/piwik/issues/4439#comment:8 and https://github.com/eaccelerator/eaccelerator/issues/12 * * Eaccelerator does not support closures and is known to be not comptabile with Piwik. Therefore we are disabling * it automatically. At this point it looks like Eaccelerator is no longer under development and the bug has not @@ -125,7 +125,7 @@ abstract class ControllerAdmin extends Controller $message = sprintf("You are using the PHP accelerator & optimizer eAccelerator which is known to be not compatible with Piwik. We have disabled eAccelerator, which might affect the performance of Piwik. Read the %srelated ticket%s for more information and how to fix this problem.", - '<a target="_blank" href="http://dev.piwik.org/trac/ticket/4439">', '</a>'); + '<a target="_blank" href="https://github.com/piwik/piwik/issues/4439">', '</a>'); $notification = new Notification($message); $notification->context = Notification::CONTEXT_WARNING; diff --git a/core/Tracker/Action.php b/core/Tracker/Action.php index 16ed954f9c0c1e0a09fd44a11d859e296b6357d7..22c0107aec9dbc5b75c5342badb416d6424e401d 100644 --- a/core/Tracker/Action.php +++ b/core/Tracker/Action.php @@ -106,9 +106,11 @@ abstract class Action } /** + * Public so that events listener can access it + * * @var Request */ - protected $request; + public $request; private $idLinkVisitAction; private $actionIdsCached = array(); diff --git a/core/Updater.php b/core/Updater.php index 2e2d4cc6ab1625239212f8ee97e37f1051f3fc08..e10c6bf33c5575f13e79bb0b48ffe6d563108609 100644 --- a/core/Updater.php +++ b/core/Updater.php @@ -360,12 +360,29 @@ class Updater public static function handleQueryError($e, $updateSql, $errorToIgnore, $file) { if (($errorToIgnore === false) - || !Db::get()->isErrNo($e, $errorToIgnore) + || !self::isDbErrorOneOf($e, $errorToIgnore) ) { $message = $file . ":\nError trying to execute the query '" . $updateSql . "'.\nThe error was: " . $e->getMessage(); throw new UpdaterErrorException($message); } } + + /** + * Returns whether an exception is a DB error with a code in the $errorCodesToIgnore list. + * + * @param int $error + * @param int|int[] $errorCodesToIgnore + */ + public static function isDbErrorOneOf($error, $errorCodesToIgnore) + { + $errorCodesToIgnore = is_array($errorCodesToIgnore) ? $errorCodesToIgnore : array($errorCodesToIgnore); + foreach ($errorCodesToIgnore as $code) { + if (Db::get()->isErrNo($error, $code)) { + return true; + } + } + return false; + } } /** diff --git a/core/Updates/0.2.10.php b/core/Updates/0.2.10.php index b42449aacc669a3b68f8c847794e57c2f62811ab..1ab471e32d9cb7dd899156af540c3a77b90146f2 100644 --- a/core/Updates/0.2.10.php +++ b/core/Updates/0.2.10.php @@ -26,27 +26,27 @@ class Updates_0_2_10 extends Updates option_name VARCHAR( 64 ) NOT NULL , option_value LONGTEXT NOT NULL , PRIMARY KEY ( idoption , option_name ) - )' => false, + )' => 1050, // 0.1.7 [463] 'ALTER IGNORE TABLE `' . Common::prefixTable('log_visit') . '` - CHANGE `location_provider` `location_provider` VARCHAR( 100 ) DEFAULT NULL' => '1054', + CHANGE `location_provider` `location_provider` VARCHAR( 100 ) DEFAULT NULL' => 1054, // 0.1.7 [470] 'ALTER TABLE `' . Common::prefixTable('logger_api_call') . '` CHANGE `parameter_names_default_values` `parameter_names_default_values` TEXT, CHANGE `parameter_values` `parameter_values` TEXT, - CHANGE `returned_value` `returned_value` TEXT' => false, + CHANGE `returned_value` `returned_value` TEXT' => array(1054, 1146), 'ALTER TABLE `' . Common::prefixTable('logger_error') . '` - CHANGE `message` `message` TEXT' => false, + CHANGE `message` `message` TEXT' => array(1054, 1146), 'ALTER TABLE `' . Common::prefixTable('logger_exception') . '` - CHANGE `message` `message` TEXT' => false, + CHANGE `message` `message` TEXT' => array(1054, 1146), 'ALTER TABLE `' . Common::prefixTable('logger_message') . '` - CHANGE `message` `message` TEXT' => false, + CHANGE `message` `message` TEXT' => 1054, // 0.2.2 [489] 'ALTER IGNORE TABLE `' . Common::prefixTable('site') . '` - CHANGE `feedburnerName` `feedburnerName` VARCHAR( 100 ) DEFAULT NULL' => '1054', + CHANGE `feedburnerName` `feedburnerName` VARCHAR( 100 ) DEFAULT NULL' => 1054, ); } diff --git a/core/Updates/0.2.12.php b/core/Updates/0.2.12.php index 975ba373cd8a96c6815c5cdb952abe14b25d30d2..0cf0fed8eaf44c85560757fea892ed4b0421dab2 100644 --- a/core/Updates/0.2.12.php +++ b/core/Updates/0.2.12.php @@ -23,11 +23,11 @@ class Updates_0_2_12 extends Updates 'ALTER TABLE `' . Common::prefixTable('site') . '` CHANGE `ts_created` `ts_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL' => false, 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` - DROP `config_color_depth`' => false, + DROP `config_color_depth`' => 1091, // 0.2.12 [673] // Note: requires INDEX privilege - 'DROP INDEX index_idaction ON `' . Common::prefixTable('log_action') . '`' => '1091', + 'DROP INDEX index_idaction ON `' . Common::prefixTable('log_action') . '`' => 1091, ); } diff --git a/core/Updates/0.2.13.php b/core/Updates/0.2.13.php index eb65347c45402f9e1b5464bc3ebfd2af18350a5c..e73acf0b777b55d358fe94d35b24805ffa85d35d 100644 --- a/core/Updates/0.2.13.php +++ b/core/Updates/0.2.13.php @@ -27,7 +27,7 @@ class Updates_0_2_13 extends Updates option_value LONGTEXT NOT NULL , autoload TINYINT NOT NULL DEFAULT '1', PRIMARY KEY ( option_name ) - )" => false, + )" => 1050, ); } diff --git a/core/Updates/0.2.24.php b/core/Updates/0.2.24.php index b4762ad15d37488014b792db48f4fc0ceae619c0..23bf21274e64cd8fb17ddd7484fc886b459309be 100644 --- a/core/Updates/0.2.24.php +++ b/core/Updates/0.2.24.php @@ -21,11 +21,11 @@ class Updates_0_2_24 extends Updates { return array( 'CREATE INDEX index_type_name - ON ' . Common::prefixTable('log_action') . ' (type, name(15))' => false, + ON ' . Common::prefixTable('log_action') . ' (type, name(15))' => 1072, 'CREATE INDEX index_idsite_date - ON ' . Common::prefixTable('log_visit') . ' (idsite, visit_server_date)' => false, - 'DROP INDEX index_idsite ON ' . Common::prefixTable('log_visit') => false, - 'DROP INDEX index_visit_server_date ON ' . Common::prefixTable('log_visit') => false, + ON ' . Common::prefixTable('log_visit') . ' (idsite, visit_server_date)' => 1072, + 'DROP INDEX index_idsite ON ' . Common::prefixTable('log_visit') => 1091, + 'DROP INDEX index_visit_server_date ON ' . Common::prefixTable('log_visit') => 1091, ); } diff --git a/core/Updates/0.2.27.php b/core/Updates/0.2.27.php index 483d915a0f9e09809153d67bad717bb3c0fa5915..615709e599100daac64d3426915ced3d2fdaec44 100644 --- a/core/Updates/0.2.27.php +++ b/core/Updates/0.2.27.php @@ -22,10 +22,10 @@ class Updates_0_2_27 extends Updates { $sqlarray = array( 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` - ADD `visit_goal_converted` VARCHAR( 1 ) NOT NULL AFTER `visit_total_time`' => false, + ADD `visit_goal_converted` VARCHAR( 1 ) NOT NULL AFTER `visit_total_time`' => 1060, // 0.2.27 [826] 'ALTER IGNORE TABLE `' . Common::prefixTable('log_visit') . '` - CHANGE `visit_goal_converted` `visit_goal_converted` TINYINT(1) NOT NULL' => false, + CHANGE `visit_goal_converted` `visit_goal_converted` TINYINT(1) NOT NULL' => 1060, 'CREATE TABLE `' . Common::prefixTable('goal') . "` ( `idsite` int(11) NOT NULL, @@ -38,7 +38,7 @@ class Updates_0_2_27 extends Updates `revenue` float NOT NULL, `deleted` tinyint(4) NOT NULL default '0', PRIMARY KEY (`idsite`,`idgoal`) - )" => false, + )" => 1050, 'CREATE TABLE `' . Common::prefixTable('log_conversion') . '` ( `idvisit` int(10) unsigned NOT NULL, @@ -61,13 +61,13 @@ class Updates_0_2_27 extends Updates `revenue` float default NULL, PRIMARY KEY (`idvisit`,`idgoal`), KEY `index_idsite_date` (`idsite`,`visit_server_date`) - )' => false, + )' => 1050, ); $tables = DbHelper::getTablesInstalled(); foreach ($tables as $tableName) { if (preg_match('/archive_/', $tableName) == 1) { - $sqlarray['CREATE INDEX index_all ON ' . $tableName . ' (`idsite`,`date1`,`date2`,`name`,`ts_archived`)'] = false; + $sqlarray['CREATE INDEX index_all ON ' . $tableName . ' (`idsite`,`date1`,`date2`,`name`,`ts_archived`)'] = 1072; } } diff --git a/core/Updates/0.4.2.php b/core/Updates/0.4.2.php index f19dda34be204f66bbbee1fe130d79e1e4f47a0b..d3cac21d21b60a59eb03a10e80e11c05d084ec0e 100644 --- a/core/Updates/0.4.2.php +++ b/core/Updates/0.4.2.php @@ -21,12 +21,12 @@ class Updates_0_4_2 extends Updates { return array( 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` - ADD `config_java` TINYINT(1) NOT NULL AFTER `config_flash`' => '1060', + ADD `config_java` TINYINT(1) NOT NULL AFTER `config_flash`' => 1060, 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` - ADD `config_quicktime` TINYINT(1) NOT NULL AFTER `config_director`' => '1060', + ADD `config_quicktime` TINYINT(1) NOT NULL AFTER `config_director`' => 1060, 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` ADD `config_gears` TINYINT(1) NOT NULL AFTER `config_windowsmedia`, - ADD `config_silverlight` TINYINT(1) NOT NULL AFTER `config_gears`' => '1060', + ADD `config_silverlight` TINYINT(1) NOT NULL AFTER `config_gears`' => 1060, ); } diff --git a/core/Updates/0.4.php b/core/Updates/0.4.php index fe3f1426d2b641dc0c4187c30839a774bd48969c..ce86db2ceee599f6b17051cd4b82c8d967f565f3 100644 --- a/core/Updates/0.4.php +++ b/core/Updates/0.4.php @@ -22,13 +22,13 @@ class Updates_0_4 extends Updates return array( // 0.4 [1140] 'UPDATE `' . Common::prefixTable('log_visit') . '` - SET location_ip=location_ip+CAST(POW(2,32) AS UNSIGNED) WHERE location_ip < 0' => false, + SET location_ip=location_ip+CAST(POW(2,32) AS UNSIGNED) WHERE location_ip < 0' => false, 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` - CHANGE `location_ip` `location_ip` BIGINT UNSIGNED NOT NULL' => false, + CHANGE `location_ip` `location_ip` BIGINT UNSIGNED NOT NULL' => 1054, 'UPDATE `' . Common::prefixTable('logger_api_call') . '` - SET caller_ip=caller_ip+CAST(POW(2,32) AS UNSIGNED) WHERE caller_ip < 0' => false, + SET caller_ip=caller_ip+CAST(POW(2,32) AS UNSIGNED) WHERE caller_ip < 0' => 1146, 'ALTER TABLE `' . Common::prefixTable('logger_api_call') . '` - CHANGE `caller_ip` `caller_ip` BIGINT UNSIGNED' => false, + CHANGE `caller_ip` `caller_ip` BIGINT UNSIGNED' => 1146, ); } diff --git a/core/Updates/0.5.5.php b/core/Updates/0.5.5.php index 28822ddbea0edac5302bb16b2e92ca846edd7608..50f6236caa511fac76218955915d628502660cf9 100644 --- a/core/Updates/0.5.5.php +++ b/core/Updates/0.5.5.php @@ -21,17 +21,17 @@ class Updates_0_5_5 extends Updates static function getSql() { $sqlarray = array( - 'DROP INDEX index_idsite_date ON ' . Common::prefixTable('log_visit') => '1091', - 'CREATE INDEX index_idsite_date_config ON ' . Common::prefixTable('log_visit') . ' (idsite, visit_server_date, config_md5config(8))' => '1061', + 'DROP INDEX index_idsite_date ON ' . Common::prefixTable('log_visit') => 1091, + 'CREATE INDEX index_idsite_date_config ON ' . Common::prefixTable('log_visit') . ' (idsite, visit_server_date, config_md5config(8))' => array(1061,1072), ); $tables = DbHelper::getTablesInstalled(); foreach ($tables as $tableName) { if (preg_match('/archive_/', $tableName) == 1) { - $sqlarray['DROP INDEX index_all ON ' . $tableName] = '1091'; + $sqlarray['DROP INDEX index_all ON ' . $tableName] = 1091; } if (preg_match('/archive_numeric_/', $tableName) == 1) { - $sqlarray['CREATE INDEX index_idsite_dates_period ON ' . $tableName . ' (idsite, date1, date2, period)'] = '1061'; + $sqlarray['CREATE INDEX index_idsite_dates_period ON ' . $tableName . ' (idsite, date1, date2, period)'] = 1061; } } diff --git a/core/Updates/0.5.php b/core/Updates/0.5.php index 81d73db8410fcc64cff53cf3ba9e4d1b4d1fd2e4..6c7a51af4e76b0f7132453b552b9e50dbed831b9 100644 --- a/core/Updates/0.5.php +++ b/core/Updates/0.5.php @@ -20,16 +20,16 @@ class Updates_0_5 extends Updates static function getSql() { return array( - 'ALTER TABLE ' . Common::prefixTable('log_action') . ' ADD COLUMN `hash` INTEGER(10) UNSIGNED NOT NULL AFTER `name`;' => '1060', - 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' CHANGE visit_exit_idaction visit_exit_idaction_url INTEGER(11) NOT NULL;' => '1054', - 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' CHANGE visit_entry_idaction visit_entry_idaction_url INTEGER(11) NOT NULL;' => '1054', - 'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' CHANGE `idaction_ref` `idaction_url_ref` INTEGER(10) UNSIGNED NOT NULL;' => '1054', - 'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' CHANGE `idaction` `idaction_url` INTEGER(10) UNSIGNED NOT NULL;' => '1054', - 'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' ADD COLUMN `idaction_name` INTEGER(10) UNSIGNED AFTER `idaction_url_ref`;' => '1060', - 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' CHANGE `idaction` `idaction_url` INTEGER(11) UNSIGNED NOT NULL;' => '1054', + 'ALTER TABLE ' . Common::prefixTable('log_action') . ' ADD COLUMN `hash` INTEGER(10) UNSIGNED NOT NULL AFTER `name`;' => 1060, + 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' CHANGE visit_exit_idaction visit_exit_idaction_url INTEGER(11) NOT NULL;' => 1054, + 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' CHANGE visit_entry_idaction visit_entry_idaction_url INTEGER(11) NOT NULL;' => 1054, + 'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' CHANGE `idaction_ref` `idaction_url_ref` INTEGER(10) UNSIGNED NOT NULL;' => 1054, + 'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' CHANGE `idaction` `idaction_url` INTEGER(10) UNSIGNED NOT NULL;' => 1054, + 'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' ADD COLUMN `idaction_name` INTEGER(10) UNSIGNED AFTER `idaction_url_ref`;' => 1060, + 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' CHANGE `idaction` `idaction_url` INTEGER(11) UNSIGNED NOT NULL;' => 1054, 'UPDATE ' . Common::prefixTable('log_action') . ' SET `hash` = CRC32(name);' => false, - 'CREATE INDEX index_type_hash ON ' . Common::prefixTable('log_action') . ' (type, hash);' => '1061', - 'DROP INDEX index_type_name ON ' . Common::prefixTable('log_action') . ';' => '1091', + 'CREATE INDEX index_type_hash ON ' . Common::prefixTable('log_action') . ' (type, hash);' => 1061, + 'DROP INDEX index_type_name ON ' . Common::prefixTable('log_action') . ';' => 1091, ); } diff --git a/core/Updates/0.6-rc1.php b/core/Updates/0.6-rc1.php index cac08f47d69ed0a28403dfd4a5fc7591a16a52ad..9f293dda97fa73c5dbbd8cf8a98572bf481fdef5 100644 --- a/core/Updates/0.6-rc1.php +++ b/core/Updates/0.6-rc1.php @@ -22,19 +22,19 @@ class Updates_0_6_rc1 extends Updates $defaultTimezone = 'UTC'; $defaultCurrency = 'USD'; return array( - 'ALTER TABLE ' . Common::prefixTable('user') . ' CHANGE date_registered date_registered TIMESTAMP NULL' => false, - 'ALTER TABLE ' . Common::prefixTable('site') . ' CHANGE ts_created ts_created TIMESTAMP NULL' => false, - 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD `timezone` VARCHAR( 50 ) NOT NULL AFTER `ts_created` ;' => false, - 'UPDATE ' . Common::prefixTable('site') . ' SET `timezone` = "' . $defaultTimezone . '";' => false, - 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD currency CHAR( 3 ) NOT NULL AFTER `timezone` ;' => false, - 'UPDATE ' . Common::prefixTable('site') . ' SET `currency` = "' . $defaultCurrency . '";' => false, - 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD `excluded_ips` TEXT NOT NULL AFTER `currency` ;' => false, - 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD excluded_parameters VARCHAR( 255 ) NOT NULL AFTER `excluded_ips` ;' => false, - 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' ADD INDEX `index_idsite_datetime_config` ( `idsite` , `visit_last_action_time` , `config_md5config` ( 8 ) ) ;' => false, - 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' ADD INDEX index_idsite_idvisit (idsite, idvisit) ;' => false, - 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' DROP INDEX index_idsite_date' => false, - 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' DROP visit_server_date;' => false, - 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' ADD INDEX index_idsite_datetime ( `idsite` , `server_time` )' => false, + 'ALTER TABLE ' . Common::prefixTable('user') . ' CHANGE date_registered date_registered TIMESTAMP NULL' => 1054, + 'ALTER TABLE ' . Common::prefixTable('site') . ' CHANGE ts_created ts_created TIMESTAMP NULL' => 1054, + 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD `timezone` VARCHAR( 50 ) NOT NULL AFTER `ts_created` ;' => 1060, + 'UPDATE ' . Common::prefixTable('site') . ' SET `timezone` = "' . $defaultTimezone . '";' => 1060, + 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD currency CHAR( 3 ) NOT NULL AFTER `timezone` ;' => 1060, + 'UPDATE ' . Common::prefixTable('site') . ' SET `currency` = "' . $defaultCurrency . '";' => 1060, + 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD `excluded_ips` TEXT NOT NULL AFTER `currency` ;' => 1060, + 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD excluded_parameters VARCHAR( 255 ) NOT NULL AFTER `excluded_ips` ;' => 1060, + 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' ADD INDEX `index_idsite_datetime_config` ( `idsite` , `visit_last_action_time` , `config_md5config` ( 8 ) ) ;' => array(1061, 1072), + 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' ADD INDEX index_idsite_idvisit (idsite, idvisit) ;' => array(1061, 1072), + 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' DROP INDEX index_idsite_date' => 1091, + 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' DROP visit_server_date;' => 1091, + 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' ADD INDEX index_idsite_datetime ( `idsite` , `server_time` )' => array(1072, 1061), ); } @@ -42,8 +42,8 @@ class Updates_0_6_rc1 extends Updates { // first we disable the plugins and keep an array of warnings messages $pluginsToDisableMessage = array( - 'SearchEnginePosition' => "SearchEnginePosition plugin was disabled, because it is not compatible with the new Piwik 0.6. \n You can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/ticket/502'>Click here.</a>", - 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 0.6. \nYou can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/ticket/45'>Click here.</a>" + 'SearchEnginePosition' => "SearchEnginePosition plugin was disabled, because it is not compatible with the new Piwik 0.6. \n You can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/502'>Click here.</a>", + 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 0.6. \nYou can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/45'>Click here.</a>" ); $disabledPlugins = array(); foreach ($pluginsToDisableMessage as $pluginToDisable => $warningMessage) { @@ -64,4 +64,4 @@ class Updates_0_6_rc1 extends Updates "</li></ul>"); } } -} +} \ No newline at end of file diff --git a/core/Updates/0.6.3.php b/core/Updates/0.6.3.php index 2a243290381b107ee87eab763234f123b55e42b8..56488304ff09d675895df5694cef7b2c214c2c19 100644 --- a/core/Updates/0.6.3.php +++ b/core/Updates/0.6.3.php @@ -22,9 +22,9 @@ class Updates_0_6_3 extends Updates { return array( 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` - CHANGE `location_ip` `location_ip` INT UNSIGNED NOT NULL' => false, + CHANGE `location_ip` `location_ip` INT UNSIGNED NOT NULL' => 1054, 'ALTER TABLE `' . Common::prefixTable('logger_api_call') . '` - CHANGE `caller_ip` `caller_ip` INT UNSIGNED' => false, + CHANGE `caller_ip` `caller_ip` INT UNSIGNED' => array(1054, 1146), ); } diff --git a/core/Updates/1.2-rc1.php b/core/Updates/1.2-rc1.php index 1be12c9e1785bd8994960569b749e19a4fdb80c3..31d8ba58bc42abc2b1fac05c70ca7536ecb5464e 100644 --- a/core/Updates/1.2-rc1.php +++ b/core/Updates/1.2-rc1.php @@ -27,7 +27,7 @@ class Updates_1_2_rc1 extends Updates DROP INDEX `index_idsite_datetime_config`, ADD `idvisitor` BINARY(8) NOT NULL AFTER `idsite`, ADD `config_id` BINARY(8) NOT NULL AFTER `config_md5config` - ' => false, + ' => array(1054, 1091), 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` ADD `visit_entry_idaction_name` INT UNSIGNED NOT NULL AFTER `visit_entry_idaction_url`, ADD `visit_exit_idaction_name` INT UNSIGNED NOT NULL AFTER `visit_exit_idaction_url`, @@ -54,7 +54,7 @@ class Updates_1_2_rc1 extends Updates ADD `idsite` INT( 10 ) UNSIGNED NOT NULL AFTER `idlink_va` , ADD `idvisitor` BINARY(8) NOT NULL AFTER `idsite`, ADD `idaction_name_ref` INT UNSIGNED NOT NULL AFTER `idaction_name` - ' => false, + ' => 1060, 'ALTER TABLE `' . Common::prefixTable('log_link_visit_action') . '` ADD `server_time` DATETIME AFTER `idsite`, ADD INDEX `index_idsite_servertime` ( `idsite` , `server_time` ) @@ -63,7 +63,7 @@ class Updates_1_2_rc1 extends Updates 'ALTER TABLE `' . Common::prefixTable('log_conversion') . '` DROP `referer_idvisit`, ADD `idvisitor` BINARY(8) NOT NULL AFTER `idsite` - ' => false, + ' => array(1060, 1091), 'ALTER TABLE `' . Common::prefixTable('log_conversion') . '` ADD visitor_count_visits SMALLINT(5) UNSIGNED NOT NULL, ADD visitor_days_since_first SMALLINT(5) UNSIGNED NOT NULL @@ -79,30 +79,30 @@ class Updates_1_2_rc1 extends Updates ADD custom_var_v4 VARCHAR(100) DEFAULT NULL, ADD custom_var_k5 VARCHAR(100) DEFAULT NULL, ADD custom_var_v5 VARCHAR(100) DEFAULT NULL - ' => 1060, + ' => array(1060, 1061), // Migrate 128bits IDs inefficiently stored as 8bytes (256 bits) into 64bits 'UPDATE ' . Common::prefixTable('log_visit') . ' SET idvisitor = binary(unhex(substring(visitor_idcookie,1,16))), config_id = binary(unhex(substring(config_md5config,1,16))) - ' => false, + ' => 1054, 'UPDATE ' . Common::prefixTable('log_conversion') . ' SET idvisitor = binary(unhex(substring(visitor_idcookie,1,16))) - ' => false, + ' => 1054, // Drop migrated fields 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` DROP visitor_idcookie, DROP config_md5config - ' => false, + ' => 1091, 'ALTER TABLE `' . Common::prefixTable('log_conversion') . '` DROP visitor_idcookie - ' => false, + ' => 1091, // Recreate INDEX on new field 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` ADD INDEX `index_idsite_datetime_config` (idsite, visit_last_action_time, config_id) - ' => false, + ' => 1061, // Backfill action logs as best as we can 'UPDATE ' . Common::prefixTable('log_link_visit_action') . ' as action, @@ -118,10 +118,10 @@ class Updates_1_2_rc1 extends Updates ' => false, // New index used max once per request, in case this table grows significantly in the future - 'ALTER TABLE `' . Common::prefixTable('option') . '` ADD INDEX ( `autoload` ) ' => false, + 'ALTER TABLE `' . Common::prefixTable('option') . '` ADD INDEX ( `autoload` ) ' => 1061, // new field for websites - 'ALTER TABLE `' . Common::prefixTable('site') . '` ADD `group` VARCHAR( 250 ) NOT NULL' => false, + 'ALTER TABLE `' . Common::prefixTable('site') . '` ADD `group` VARCHAR( 250 ) NOT NULL' => 1060, ); } @@ -129,7 +129,7 @@ class Updates_1_2_rc1 extends Updates { // first we disable the plugins and keep an array of warnings messages $pluginsToDisableMessage = array( - 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 1.2. \nYou can download the latest version of the plugin, compatible with Piwik 1.2.\n<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/ticket/45'>Click here.</a>", + 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 1.2. \nYou can download the latest version of the plugin, compatible with Piwik 1.2.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/45'>Click here.</a>", 'EntryPage' => "EntryPage plugin is not compatible with this version of Piwik, it was disabled.", ); $disabledPlugins = array(); diff --git a/core/Updates/1.2.3.php b/core/Updates/1.2.3.php index ae28ee7e9e4cee1348770a70a6458082b8dcc624..d240462468d6323203a9b7995bed7771ddef2aa2 100644 --- a/core/Updates/1.2.3.php +++ b/core/Updates/1.2.3.php @@ -22,14 +22,14 @@ class Updates_1_2_3 extends Updates { return array( // LOAD DATA INFILE uses the database's charset - 'ALTER DATABASE `' . Config::getInstance()->database['dbname'] . '` DEFAULT CHARACTER SET utf8' => false, + 'ALTER DATABASE `' . Config::getInstance()->database['dbname'] . '` DEFAULT CHARACTER SET utf8' => false, // Various performance improvements schema updates 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` DROP INDEX index_idsite_datetime_config, DROP INDEX index_idsite_idvisit, ADD INDEX index_idsite_config_datetime (idsite, config_id, visit_last_action_time), - ADD INDEX index_idsite_datetime (idsite, visit_last_action_time)' => false, + ADD INDEX index_idsite_datetime (idsite, visit_last_action_time)' => array(1061, 1091), ); } diff --git a/core/Updates/1.2.5-rc1.php b/core/Updates/1.2.5-rc1.php index a4f6ee02bba6223438eb70a2d74f2043b663cb36..af6308ad8ad57bc372315fa034cce63741118d80 100644 --- a/core/Updates/1.2.5-rc1.php +++ b/core/Updates/1.2.5-rc1.php @@ -21,11 +21,11 @@ class Updates_1_2_5_rc1 extends Updates { return array( 'ALTER TABLE `' . Common::prefixTable('goal') . '` - ADD `allow_multiple` tinyint(4) NOT NULL AFTER case_sensitive' => false, + ADD `allow_multiple` tinyint(4) NOT NULL AFTER case_sensitive' => 1060, 'ALTER TABLE `' . Common::prefixTable('log_conversion') . '` ADD buster int unsigned NOT NULL AFTER revenue, DROP PRIMARY KEY, - ADD PRIMARY KEY (idvisit, idgoal, buster)' => false, + ADD PRIMARY KEY (idvisit, idgoal, buster)' => 1060, ); } diff --git a/core/Updates/1.2.5-rc7.php b/core/Updates/1.2.5-rc7.php index 08284dd07fdce18a11236bac10fec78c5a60a5a9..94671da03820c37f9f436bae5449137e7e36bd45 100644 --- a/core/Updates/1.2.5-rc7.php +++ b/core/Updates/1.2.5-rc7.php @@ -21,7 +21,7 @@ class Updates_1_2_5_rc7 extends Updates { return array( 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` - ADD INDEX index_idsite_idvisitor (idsite, idvisitor)' => false, + ADD INDEX index_idsite_idvisitor (idsite, idvisitor)' => 1061, ); } diff --git a/core/Updates/1.4-rc1.php b/core/Updates/1.4-rc1.php index 3697864ce128359102929e990cdb1776737d7e33..5290e8d24b9367cc9baac23b422e5a16bf722b79 100644 --- a/core/Updates/1.4-rc1.php +++ b/core/Updates/1.4-rc1.php @@ -21,7 +21,7 @@ class Updates_1_4_rc1 extends Updates { return array( 'UPDATE `' . Common::prefixTable('pdf') . '` - SET format = "pdf"' => '42S22', + SET format = "pdf"' => '42S22', 'ALTER TABLE `' . Common::prefixTable('pdf') . '` ADD COLUMN `format` VARCHAR(10)' => '42S22', ); diff --git a/core/Updates/1.4-rc2.php b/core/Updates/1.4-rc2.php index b2a3b3176c03884b27a6b7ca5104d282f417a535..a54ab231c0e2fd0184bce8546284c6964fb7d823 100644 --- a/core/Updates/1.4-rc2.php +++ b/core/Updates/1.4-rc2.php @@ -20,20 +20,20 @@ class Updates_1_4_rc2 extends Updates static function getSql() { return array( - "SET sql_mode=''" => false, + "SET sql_mode=''" => false, // this converts the 32-bit UNSIGNED INT column to a 16 byte VARBINARY; // _but_ MySQL does string conversion! (e.g., integer 1 is converted to 49 -- the ASCII code for "1") 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' MODIFY location_ip VARBINARY(16) NOT NULL' => false, 'ALTER TABLE ' . Common::prefixTable('logger_api_call') . ' - MODIFY caller_ip VARBINARY(16) NOT NULL' => false, + MODIFY caller_ip VARBINARY(16) NOT NULL' => 1146, // fortunately, 2^32 is 10 digits long and fits in the VARBINARY(16) without truncation; // to fix this, we cast to an integer, convert to hex, pad out leading zeros, and unhex it 'UPDATE ' . Common::prefixTable('log_visit') . " SET location_ip = UNHEX(LPAD(HEX(CONVERT(location_ip, UNSIGNED)), 8, '0'))" => false, 'UPDATE ' . Common::prefixTable('logger_api_call') . " - SET caller_ip = UNHEX(LPAD(HEX(CONVERT(caller_ip, UNSIGNED)), 8, '0'))" => false, + SET caller_ip = UNHEX(LPAD(HEX(CONVERT(caller_ip, UNSIGNED)), 8, '0'))" => 1146, ); } diff --git a/core/Updates/1.5-b1.php b/core/Updates/1.5-b1.php index 23bfbe2f84437d477d0ea2356320ca08057962c5..9a8ed9653d1f5089e7becb3bb1726e610f2a63b9 100644 --- a/core/Updates/1.5-b1.php +++ b/core/Updates/1.5-b1.php @@ -37,7 +37,7 @@ class Updates_1_5_b1 extends Updates PRIMARY KEY(idvisit, idorder, idaction_sku), INDEX index_idsite_servertime ( idsite, server_time ) - ) DEFAULT CHARSET=utf8 ' => false, + ) DEFAULT CHARSET=utf8 ' => 1050, 'ALTER IGNORE TABLE `' . Common::prefixTable('log_visit') . '` ADD visitor_days_since_order SMALLINT(5) UNSIGNED NOT NULL AFTER visitor_days_since_last, @@ -53,7 +53,7 @@ class Updates_1_5_b1 extends Updates ADD revenue_shipping float default NULL, ADD revenue_discount float default NULL, ADD UNIQUE KEY unique_idsite_idorder (idsite, idorder), - MODIFY idgoal int(10) NOT NULL' => false, + MODIFY idgoal int(10) NOT NULL' => 1060, ); } diff --git a/core/Updates/1.5-b4.php b/core/Updates/1.5-b4.php index 318552e3b7127fe0f4991c36632d27d5065fe0d8..802992f6ae1a6cfb3b4e08f31a4e732073d36a1d 100644 --- a/core/Updates/1.5-b4.php +++ b/core/Updates/1.5-b4.php @@ -21,7 +21,7 @@ class Updates_1_5_b4 extends Updates { return array( 'ALTER TABLE `' . Common::prefixTable('site') . '` - ADD ecommerce TINYINT DEFAULT 0' => false, + ADD ecommerce TINYINT DEFAULT 0' => 1060, ); } diff --git a/core/Updates/1.5-b5.php b/core/Updates/1.5-b5.php index 8f3ef447f28691763eee021a7cfb775a95548c77..5b13385fd85d7211825365ceae866443f159fa19 100644 --- a/core/Updates/1.5-b5.php +++ b/core/Updates/1.5-b5.php @@ -26,7 +26,7 @@ class Updates_1_5_b5 extends Updates lifetime INTEGER, data TEXT, PRIMARY KEY ( id ) - ) DEFAULT CHARSET=utf8' => false, + ) DEFAULT CHARSET=utf8' => 1050, ); } diff --git a/core/Updates/1.6-b1.php b/core/Updates/1.6-b1.php index c200e5bf12f370717c0e2b5ebbe19c132165d155..f28fc487cc23768459612d4a119c2d5fda064b02 100644 --- a/core/Updates/1.6-b1.php +++ b/core/Updates/1.6-b1.php @@ -24,7 +24,7 @@ class Updates_1_6_b1 extends Updates ADD idaction_category2 INTEGER(10) UNSIGNED NOT NULL AFTER idaction_category, ADD idaction_category3 INTEGER(10) UNSIGNED NOT NULL, ADD idaction_category4 INTEGER(10) UNSIGNED NOT NULL, - ADD idaction_category5 INTEGER(10) UNSIGNED NOT NULL' => false, + ADD idaction_category5 INTEGER(10) UNSIGNED NOT NULL' => 1060, 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` CHANGE custom_var_k1 custom_var_k1 VARCHAR(200) DEFAULT NULL, CHANGE custom_var_v1 custom_var_v1 VARCHAR(200) DEFAULT NULL, diff --git a/core/Updates/1.7-b1.php b/core/Updates/1.7-b1.php index 91f63e03095a756d9f46f179c1e766d7896fb27f..676065d3bd815800d539beaad2349a78ef9cc779 100644 --- a/core/Updates/1.7-b1.php +++ b/core/Updates/1.7-b1.php @@ -21,7 +21,7 @@ class Updates_1_7_b1 extends Updates { return array( 'ALTER TABLE `' . Common::prefixTable('pdf') . '` - ADD COLUMN `aggregate_reports_format` TINYINT(1) NOT NULL AFTER `reports`' => false, + ADD COLUMN `aggregate_reports_format` TINYINT(1) NOT NULL AFTER `reports`' => 1060, 'UPDATE `' . Common::prefixTable('pdf') . '` SET `aggregate_reports_format` = 1' => false, ); diff --git a/core/Updates/1.7.2-rc7.php b/core/Updates/1.7.2-rc7.php index 2f479c0522bbdeae1ae1e9e5a5f59718226c0c1a..87ae2fc035e10df6cce8ca3e680e0f600a349042 100755 --- a/core/Updates/1.7.2-rc7.php +++ b/core/Updates/1.7.2-rc7.php @@ -22,7 +22,7 @@ class Updates_1_7_2_rc7 extends Updates { return array( 'ALTER TABLE `' . Common::prefixTable('user_dashboard') . '` - ADD `name` VARCHAR( 100 ) NULL DEFAULT NULL AFTER `iddashboard`' => false, + ADD `name` VARCHAR( 100 ) NULL DEFAULT NULL AFTER `iddashboard`' => 1060, ); } diff --git a/core/Updates/2.0.4-b5.php b/core/Updates/2.0.4-b5.php index 24c0e0d589ce0233fc3ea57b0ecbef6d45922d54..94e6a6529d04c0895c0435ed64e402a8fc6deea6 100644 --- a/core/Updates/2.0.4-b5.php +++ b/core/Updates/2.0.4-b5.php @@ -56,7 +56,10 @@ class Updates_2_0_4_b5 extends Updates $superUser = null; } - if (!empty($superUser['bridge']) || empty($superUser)) { + if (!empty($superUser['bridge']) + || empty($superUser) + || empty($superUser['login']) + ) { // there is a super user which is not from the config but from the bridge, that means we already have // a super user in the database return; diff --git a/core/Version.php b/core/Version.php index 68a8887f57a5611d74192597b304bafb6dac360e..b11fa037d45a572e973e964c7ca3a2ac513aca37 100644 --- a/core/Version.php +++ b/core/Version.php @@ -21,5 +21,5 @@ final class Version * The current Piwik version. * @var string */ - const VERSION = '2.5.0-b1'; + const VERSION = '2.4.0'; } diff --git a/lang/cs.json b/lang/cs.json index c8853a2bdb7aa28823d80433dc516af83f3db7df..2cc8872ca9dea0f522ca7370abfc852feff52f65 100644 --- a/lang/cs.json +++ b/lang/cs.json @@ -437,7 +437,6 @@ "ContactThePiwikTeam": "Kontaktujte tým Piwiku", "DoYouHaveBugReportOrFeatureRequest": "Máte hlášenà chyby, nebo námÄ›t na vylepÅ¡enÃ?", "GetInTouch": "Jsme rádi za vaÅ¡i zpÄ›tnou vazbu a vždy Äteme vÅ¡echny zprávy. Možná chcete nabÃdnout podnikatelskou pÅ™Ãležitost, najmout Piwik konzultanta, podÄ›lit se o váš úspÄ›ch, nebo prostÄ› pozdravit.", - "HowToCreateIssue": "ProsÃm, pÅ™eÄtÄ›te si doporuÄenÃ, jak psát dobré %1$shlášenà chyby%2$s nebo %3$sžádost o vlastnost%4$s. Potom %5$sse zaregistrujte%6$s nebo %7$spÅ™ihlaste%8$s v naÅ¡em systému sledovánà problémů a vytvoÅ™te %9$snový problém%10$s.", "IWantTo": "Chci:", "LearnWaysToParticipate": "NauÄit způsoby jak %s spolupracovat %s", "ManuallySendEmailTo": "ProsÃm poÅ¡lete ruÄnÄ› zprávu", diff --git a/lang/da.json b/lang/da.json index 7770291eebf84d64f7a58b9c3ab9519ba8b1118f..72eadb045dde98c18a0830ea97f7c7781385b017 100644 --- a/lang/da.json +++ b/lang/da.json @@ -449,7 +449,6 @@ "ContactThePiwikTeam": "Kontakt Piwik holdet", "DoYouHaveBugReportOrFeatureRequest": "Har du en fejlrapport eller en anmodning om en funktion?", "GetInTouch": "Vi værdsætter din feedback og læser altid alle meddelelser uanset om du har en forretningsidé, ønsker at finde en Piwik konsulent, fortæl os en succeshistorie eller blot sige hej!", - "HowToCreateIssue": "Læs anbefalingerne om at skrive en god %1$sfejlrapport%2$s eller %3$sfunktionsforslag%4$s. Derefter %5$sregister%6$s eller %7$slogind%8$s pÃ¥ vores emne tracker og opret en %9$snyt emne%10$s.", "IWantTo": "Jeg ønsker at:", "LearnWaysToParticipate": "Lær om alle de mÃ¥der, du kan %s bidrage%s", "ManuallySendEmailTo": "Send din besked manuelt til", diff --git a/lang/de.json b/lang/de.json index 1ea591646a22ade628879954b453e97f5ebacd99..482dee727004ee1339f528112caae4b89d31b406 100644 --- a/lang/de.json +++ b/lang/de.json @@ -446,7 +446,6 @@ "ContactThePiwikTeam": "Kontaktieren Sie das Piwik Team!", "DoYouHaveBugReportOrFeatureRequest": "Möchten Sie einen Fehler melden oder haben Sie eine Idee für eine neue Funktion?", "GetInTouch": "Wir wissen Ihr Feedback zu schätzen und lesen alle Nachrichten. Vielleicht wollen Sie ja eine Geschäftsmöglichkeit teilen, einen Piwik-Berater buchen, uns eine Erfolgsgeschichte erzählen oder einfach nur Hallo sagen!", - "HowToCreateIssue": "Bitte lesen Sie die Empfehlungen, wie man einen guten %1$sFehlerbericht%2$s oder %3$sVorschlag für eine neue Funktion%4$s schreibt.Im Anschluss %5$sregistrieren%6$s Sie sich oder %7$smelden%8$s sich an unserem Issue Tracker an und erstellen eine %9$sneue Meldung%10$s.", "IWantTo": "Ich möchte:", "LearnWaysToParticipate": "Lernen Sie alle Möglichkeiten kennen, wie Sie %s uns unterstützen können%s", "ManuallySendEmailTo": "Senden Sie Ihre Nachricht manuell an", diff --git a/lang/el.json b/lang/el.json index 2fe13a93f97c0168c0bee5e01a0e627435c8d75a..12b2d2dd3a9d8b9ced049f29927010f0a47b673c 100644 --- a/lang/el.json +++ b/lang/el.json @@ -448,7 +448,6 @@ "ContactThePiwikTeam": "Επικοινωνήστε με την ομάδα του Piwik!", "DoYouHaveBugReportOrFeatureRequest": "Έχετε να αναφÎÏετε Îνα Ï€Ïόβλημα ή Îνα αίτημα για χαÏακτηÏιστικό;", "GetInTouch": "ΕυχαÏιστοÏμε για τα σχόλιά σας και να ξÎÏετε ότι διαβάζουμε όλα τα μηνÏματα. ΜποÏεί να θÎλετε να μοιÏαστείτε μαζί μας μια επιχειÏηματική ευκαιÏία εÏγασίας, να μας πείτε την ιστοÏία επιτυχίας σας ή απλά να πείτε Îνα Γεια!", - "HowToCreateIssue": "ΠαÏακαλοÏμε διαβάστε τις Ï€Ïοτάσεις για το πως να γÏάφετε μια καλή %1$sαναφοÏά σφάλματος%2$s ή Îνα %3$sαίτημα για νÎο χαÏακτηÏιστικό%4$s. Στη συνÎχεια, %5$sεγγÏαφείτε%6$s ή %7$sκάνετε είσοδο%8$s στην παÏακολοÏθηση σφαλμάτων και δημιουÏγήστε Îνα %9$sνÎο αίτημα%10$s.", "IWantTo": "ΘÎλω να:", "LearnWaysToParticipate": "Μάθετε όλους του Ï„Ïόπους που μποÏείτε να %sσυμμετÎχετε%s", "ManuallySendEmailTo": "Στείλτε χειÏοκίνητα το μήνυμά σας στον\/στην", diff --git a/lang/en.json b/lang/en.json index 3f9f4a6aedafb674001968fd6bb177373935681d..b9699f92267739a7da8a1f2aaa897953d4444c7d 100644 --- a/lang/en.json +++ b/lang/en.json @@ -451,7 +451,7 @@ "ContactThePiwikTeam": "Contact the Piwik team!", "DoYouHaveBugReportOrFeatureRequest": "Do you have a bug to report or a feature request?", "GetInTouch": "We appreciate your feedback and always read all messages. Maybe you would like to share a business opportunity, hire a Piwik consultant, tell us a success story or simply say Hello!", - "HowToCreateIssue": "Please read the recommendations on writing a good %1$sbug report%2$s or %3$sfeature request%4$s. Then %5$sregister%6$s or %7$slogin%8$s on our issue tracker and create a %9$snew issue%10$s.", + "HowToCreateTicket": "Please read the recommendations on writing a good %1$sbug report%2$s or %3$sfeature request%4$s. Then register or login on %5$sour issue tracker%6$s and create a %7$snew issue%8$s.", "IWantTo": "I want to:", "LearnWaysToParticipate": "Learn about all the ways you can %s participate%s", "ManuallySendEmailTo": "Please manually send your message to", @@ -2021,7 +2021,7 @@ "GeoIPServerVarsFound": "Piwik detects the following GeoIP %s variables", "GeoIPUpdaterInstructions": "Enter the download links for your databases below. If you've purchased databases from %3$sMaxMind%4$s, you can find these links %1$shere%2$s. Please contact %3$sMaxMind%4$s if you have trouble accessing them.", "GeoIPUpdaterIntro": "Piwik is currently managing updates for the following GeoIP databases", - "GeoLiteCityLink": "If you're using the GeoLite City database, use this link: %1$s%2$s%3$s.", + "GeoLiteCityLink": "If you're using the GeoLite City database, use this link: %1$s%2$s%3$s", "Geolocation": "Geolocation", "GeolocationPageDesc": "On this page you can change how Piwik determines visitor locations.", "getCityDocumentation": "This report shows the cities your visitors were in when they accessed your website.", diff --git a/lang/es.json b/lang/es.json index ed5b80b73f239671a568879e8ddb9d6eeeb9ba91..f9d8c789cfd6b84e7004c94926f174a1c8ab7562 100644 --- a/lang/es.json +++ b/lang/es.json @@ -447,7 +447,6 @@ "ContactThePiwikTeam": "Contacta al equipo de Piwik!", "DoYouHaveBugReportOrFeatureRequest": "Tienes un error que reportar o una nueva caracterÃstica?", "GetInTouch": "Agradecemos tu feedback, nosotros leemos siempre todos los mensajes. Quizá te gustarÃa compartir una oportunidad comercial, contratar un consultor de Piwik, o contarnos sobre un éxito empresarial interesante o simplemente mandarnos un saludo!", - "HowToCreateIssue": "Por favor lee las recomendaciones para escribir un %1$sinforme de errores%2$s o una %3$ssolicitud de función%4$s correctamente. Luego debes %5$sregistrarte%6$s o %7$siniciar sesión%8$s en nuestro seguidor de incidentes para crear un %9$snuevo incidente%10$s.", "IWantTo": "Yo quiero:", "LearnWaysToParticipate": "Aprende sobre todas las formas de %sparticipar%s", "ManuallySendEmailTo": "Por favor envÃe su mensaje manualmente a", diff --git a/lang/fr.json b/lang/fr.json index 1c689e60a28f6487eafebf912185db0b88ca863b..160b09386a91fda7084d48a6f691c579b1c5d8d6 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -449,7 +449,6 @@ "ContactThePiwikTeam": "Contactez l’Équipe Piwik!", "DoYouHaveBugReportOrFeatureRequest": "Avez-vous un bug à rapporter ou une fonctionnalité à demander?", "GetInTouch": "Nous apprécions vos commentaires et lisons tous les messages. Peut-être voudriez vous nous informer d'une opportunité commerciale, employer un consultant, nous raconter un succès ou simplement dire bonjour!", - "HowToCreateIssue": "Merci de lire la documentation sur la bonne manière d'écrire un %1$srapport de bug%2$s ou %3$sune demande de nouvelle fonctionnalité%4$s. Ensuite, %5$senregistrez-vous%6$s ou %7$sconnectez-vous%8$s sur notre gestionnaire d'incidents puis créez un %9$snouveau ticket%10$s.", "IWantTo": "Je veux:", "LearnWaysToParticipate": "Renseignez vous sur les manières dont vous pouvez %s participer%s", "ManuallySendEmailTo": "Merci d'envoyer manuellement votre message à ", diff --git a/lang/it.json b/lang/it.json index e9cdc1dcb71042244f5e05d7c13f53a14062a892..fe98305035748b09ddbb4afadbb39b26c9eaf31f 100644 --- a/lang/it.json +++ b/lang/it.json @@ -449,7 +449,6 @@ "ContactThePiwikTeam": "Contatta il team Piwik!", "DoYouHaveBugReportOrFeatureRequest": "Hai un bug da segnalare o una richiesta di funzionalità ?", "GetInTouch": "Apprezziamo il tuo feedback e leggiamo sempre tutti i messaggi. Ma forse vorresti condividere qualche opportunità commerciale, ingaggiare un consulente di Piwik, raccontarci una storia di successi o semplicemente dirci Ciao!", - "HowToCreateIssue": "Si prega di leggere le raccomandazioni su come scrivere un buon %1$srapporto sui bugs%2$s o una %3$srichiesta di funzionalità %4$s. Quindi %5$sregistrati%6$s o %7$saccedi%8$s al nostro tracker dei problemi e crea un %9$snuovo problema%10$s.", "IWantTo": "Vorrei:", "LearnWaysToParticipate": "Impara tutti i modi attraverso i quali puoi %s partecipare %s", "ManuallySendEmailTo": "Perfavore invia manualmente il messaggio a", diff --git a/lang/ro.json b/lang/ro.json index 5d9626b4588303fb1d9d4a787be696546b2aa756..4b4b0c6b8f0ee52882ec95afaff56bb2a788ee11 100644 --- a/lang/ro.json +++ b/lang/ro.json @@ -448,7 +448,6 @@ "ContactThePiwikTeam": "Contactează echipa Piwik!", "DoYouHaveBugReportOrFeatureRequest": "DoreÅŸti să raportezi o problemă sau să propui o înbunătăţire?", "GetInTouch": "Noi apreciem parerea dvs si citim intotdeauna toate mesajele. Poate ca doriti sa ne propuneti o oportunitate de afacere, sa angajati un consultant Piwik, sa ne spuneti o poveste de succes sau doar sa ne spuneti un simplu Salut!", - "HowToCreateIssue": "Va rugam cititi recomandarile pentru a scrie un bun %1$sbug report%2$s sau %3$sfeature request%4$s. Apoi %5$sinregistrati-va%6$s or %7$sautentificati-va%8$s pe pagina noastra unde urmarim problemele aparute si creati un %9$snou ticket%10$s.", "IWantTo": "Doresc să:", "LearnWaysToParticipate": "Invata despre toate modalitatile in care poti %s participa%s", "ManuallySendEmailTo": "Va rugam trimiteti manual mesajul dvs catre", diff --git a/lang/sr.json b/lang/sr.json index 5f8306ae63c733dddda651f4d3df790eab614b2a..424dd8f357fcf019a9dfaf4ab2571b15c84997d4 100644 --- a/lang/sr.json +++ b/lang/sr.json @@ -446,7 +446,6 @@ "ContactThePiwikTeam": "Kontaktirajte Piwik tim!", "DoYouHaveBugReportOrFeatureRequest": "Da li želite da prijavite greÅ¡ku u programu ili imate neku želju?", "GetInTouch": "Zahvaljujemo vam na interesovanju, mi uvek proÄitamo sve poruke. Možda želite da podelite sa nama poslovnu ponudu, unajmite Piwik konsultanta, da nam ispriÄate uspeÅ¡nu priÄu ili jednostavno da nas pozdravite!", - "HowToCreateIssue": "Molimo vas da prvo proÄitate preporuke kako se piÅ¡e dobar %1$sizveÅ¡taj o greÅ¡ci%2$s ili %3$szahtev za novom funkcionalnošću%4$s. Zatim se %5$sregistrujte%6$s ili %7$sprijavite%8$s na naÅ¡ sajt i otvorite %9$snovi tiket%10$s.", "IWantTo": "Želim da:", "LearnWaysToParticipate": "Pogledajte kako sve možete da %s uzmete uÄešće%s", "ManuallySendEmailTo": "Molimo vas da poÅ¡aljete poruku na", diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py index a007ab1d85656f31890e220eb2f3ad9002c76845..f986e580b4e078e3dc3218d851e84882afab04a2 100755 --- a/misc/log-analytics/import_logs.py +++ b/misc/log-analytics/import_logs.py @@ -933,7 +933,7 @@ class Piwik(object): args.update(kwargs) # Convert lists into appropriate format. - # See: http://dev.piwik.org/trac/wiki/API/Reference#PassinganArrayParameter + # See: http://developer.piwik.org/api-reference/reporting-api#passing-an-array-of-data-as-a-parameter # Warning: we have to pass the parameters in order: foo[0], foo[1], foo[2] # and not foo[1], foo[0], foo[2] (it will break Piwik otherwise.) final_args = [] diff --git a/misc/others/test_cookies_GenerateHundredsWebsitesAndVisits.php b/misc/others/test_cookies_GenerateHundredsWebsitesAndVisits.php index 70040f497e08974f709ef79df9a83ca47d13396e..b8030333a2232c75adf1883d4906ae22cf9b5b12 100644 --- a/misc/others/test_cookies_GenerateHundredsWebsitesAndVisits.php +++ b/misc/others/test_cookies_GenerateHundredsWebsitesAndVisits.php @@ -1,6 +1,6 @@ <?php // Script that creates 100 websites, then outputs a IMG that records a pageview in each website -// Used initially to test how to handle cookies for this use case (see http://dev.piwik.org/trac/ticket/409) +// Used initially to test how to handle cookies for this use case (see https://github.com/piwik/piwik/issues/409) use Piwik\Common; use Piwik\FrontController; use Piwik\Piwik; diff --git a/misc/package/build.sh b/misc/package/build.sh index de6ae59d99db5cce101a4064f84ccd999ec96306..35b230f47a1c3aaad2921abe67be3f4254c08e42 100755 --- a/misc/package/build.sh +++ b/misc/package/build.sh @@ -104,7 +104,7 @@ fi echo "Starting build...." ############################ -# Setting umask so it works for most users, see http://dev.piwik.org/trac/ticket/3869 +# Setting umask so it works for most users, see https://github.com/piwik/piwik/issues/3869 UMASK=`umask` umask 0022 diff --git a/plugins/API/API.php b/plugins/API/API.php index 7e4f7eb62de4de4bb334b550da6c438b4c0bb528..3253ae5f2120b434c8b227e893b5a2c1cfbf2942 100644 --- a/plugins/API/API.php +++ b/plugins/API/API.php @@ -55,7 +55,6 @@ class API extends \Piwik\Plugin\API public function getPiwikVersion() { Piwik::checkUserHasSomeViewAccess(); - Piwik::checkUserIsNotAnonymous(); return Version::VERSION; } diff --git a/plugins/API/ProcessedReport.php b/plugins/API/ProcessedReport.php index ad25c5aa0b0a1858d19fb50fa268bba5fb13e9fc..86a7fd169830c40961a29c0a96aeb53b9295ab70 100644 --- a/plugins/API/ProcessedReport.php +++ b/plugins/API/ProcessedReport.php @@ -697,7 +697,7 @@ class ProcessedReport // generate 'human readable' metric values // if we handle MultiSites.getAll we do not always have the same idSite but different ones for - // each site, see http://dev.piwik.org/trac/ticket/5006 + // each site, see https://github.com/piwik/piwik/issues/5006 $idSiteForRow = $idSite; if ($row->getMetadata('idsite') && is_numeric($row->getMetadata('idsite'))) { $idSiteForRow = (int) $row->getMetadata('idsite'); diff --git a/plugins/API/RowEvolution.php b/plugins/API/RowEvolution.php index 705bdb2a6e195b58f153a56391b6d3cd35e09d77..69bb5e2f5643142c0580544b357daab9c4f5ee03 100644 --- a/plugins/API/RowEvolution.php +++ b/plugins/API/RowEvolution.php @@ -204,10 +204,13 @@ class RowEvolution $replaceRegex = "/\\s*" . preg_quote(LabelFilter::SEPARATOR_RECURSIVE_LABEL) . "\\s*/"; $cleanLabel = preg_replace($replaceRegex, '/', $label); - return $mainUrlHost . '/' . $cleanLabel . '/'; + $result = $mainUrlHost . '/' . $cleanLabel . '/'; } else { - return str_replace(LabelFilter::SEPARATOR_RECURSIVE_LABEL, ' - ', $label); + $result = str_replace(LabelFilter::SEPARATOR_RECURSIVE_LABEL, ' - ', $label); } + + // remove @ terminal operator occurances + return str_replace(LabelFilter::TERMINAL_OPERATOR, '', $result); } /** diff --git a/plugins/CoreConsole/Commands/CoreArchiver.php b/plugins/CoreConsole/Commands/CoreArchiver.php index 570b1dc74d731c74d2ebab15f6dc70cef2d414bd..89b6bd9a9b6d6af6e7b3458cf5a6e36246495635 100644 --- a/plugins/CoreConsole/Commands/CoreArchiver.php +++ b/plugins/CoreConsole/Commands/CoreArchiver.php @@ -31,7 +31,7 @@ class CoreArchiver extends ConsoleCommand } if (is_string($url) && $url && in_array($url, array('http://', 'https://'))) { - // see http://dev.piwik.org/trac/ticket/5180 and http://forum.piwik.org/read.php?2,115274 + // see https://github.com/piwik/piwik/issues/5180 and http://forum.piwik.org/read.php?2,115274 throw new \InvalidArgumentException('No valid URL given. If you have specified a valid URL try --piwik-domain instead of --url'); } diff --git a/plugins/CoreConsole/Commands/TestsSetupFixture.php b/plugins/CoreConsole/Commands/TestsSetupFixture.php index c04d057217d7505398e8ca4b8df1187ba8c0e05f..1d38f9f3bfb3efc327ae1b3a27bec13a34e7cc00 100644 --- a/plugins/CoreConsole/Commands/TestsSetupFixture.php +++ b/plugins/CoreConsole/Commands/TestsSetupFixture.php @@ -11,6 +11,7 @@ namespace Piwik\Plugins\CoreConsole\Commands; use Piwik\Config; use Piwik\Plugin\ConsoleCommand; use Piwik\Url; +use Piwik\Tests\Fixture; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -18,6 +19,28 @@ use Symfony\Component\Console\Output\OutputInterface; /** * Console commands that sets up a fixture either in a local MySQL database or a remote one. + * + * Examples: + * + * To setup a fixture provided by Piwik: + * + * ./console tests:setup-fixture UITestFixture + * + * To setup your own fixture created solely for test purposes and stored outside of Piwik: + * + * ./console tests:setup-fixture MyFixtureType --file=../devfixtures/MyFixtureType.php + * + * To setup a fixture or use existing data if present: + * + * ./console tests:setup-fixture UITestFixture --persist-fixture-data + * + * To re-setup a fixture that is already present: + * + * ./console tests:setup-fixture UITestFixture --persist-fixture-data --drop + * + * To create an SQL dump for a fixture: + * + * ./console tests:setup-fixture OmniFixture --sqldump=OmniFixtureDump.sql */ class TestsSetupFixture extends ConsoleCommand { @@ -49,6 +72,8 @@ class TestsSetupFixture extends ConsoleCommand $this->addOption('drop', null, InputOption::VALUE_NONE, "Forces the database to be dropped before setting up the fixture. Should be used in conjunction with" . " --persist-fixture-data when updating a pre-existing test database."); + $this->addOption('sqldump', null, InputOption::VALUE_REQUIRED, + "Creates an SQL dump after setting up the fixture and outputs the dump to the file specified by this option."); $this->addOption('set-phantomjs-symlinks', null, InputOption::VALUE_NONE, "Used by UI tests. Creates symlinks to root directory in tests/PHPUnit/proxy."); $this->addOption('server-global', null, InputOption::VALUE_REQUIRED, @@ -64,26 +89,88 @@ class TestsSetupFixture extends ConsoleCommand $_SERVER = json_decode($serverGlobal, true); } - $this->requireFixtureFiles(); + $this->requireFixtureFiles($input); $this->setIncludePathAsInTestBootstrap(); - $file = $input->getOption('file'); - if ($file) { - if (is_file($file)) { - require_once $file; - } else if (is_file(PIWIK_INCLUDE_PATH . '/' . $file)) { - require_once PIWIK_INCLUDE_PATH . '/' . $file; - } else { - throw new \Exception("Cannot find --file option file '$file'."); - } - } - $host = Url::getHost(); if (empty($host)) { Url::setHost('localhost'); } - // get the fixture class + $fixture = $this->createFixture($input); + + $this->setupDatabaseOverrides($input, $fixture); + + // perform setup and/or teardown + if ($input->getOption('teardown')) { + $fixture->getTestEnvironment()->save(); + $fixture->performTearDown(); + } else { + $fixture->performSetUp(); + } + + if ($input->getOption('set-phantomjs-symlinks')) { + $this->createSymbolicLinksForUITests(); + } + + $this->writeSuccessMessage($output, array("Fixture successfully setup!")); + + $sqlDumpPath = $input->getOption('sqldump'); + if ($sqlDumpPath) { + $this->createSqlDump($sqlDumpPath, $output); + } + } + + private function createSymbolicLinksForUITests() + { + // make sure symbolic links exist (phantomjs doesn't support symlink-ing yet) + foreach (array('libs', 'plugins', 'tests', 'piwik.js') as $linkName) { + $linkPath = PIWIK_INCLUDE_PATH . '/tests/PHPUnit/proxy/' . $linkName; + if (!file_exists($linkPath)) { + symlink(PIWIK_INCLUDE_PATH . '/' . $linkName, $linkPath); + } + } + } + + private function createSqlDump($sqlDumpPath, OutputInterface $output) + { + $output->write("<info>Creating SQL dump...</info>"); + + $databaseConfig = Config::getInstance()->database; + $dbUser = $databaseConfig['username']; + $dbPass = $databaseConfig['password']; + $dbHost = $databaseConfig['host']; + $dbName = $databaseConfig['dbname']; + + $command = "mysqldump --user='$dbUser' --password='$dbPass' --host='$dbHost' '$dbName' > '$sqlDumpPath'"; + passthru($command); + + $this->writeSuccessMessage($output, array("SQL dump created!")); + } + + private function setupDatabaseOverrides(InputInterface $input, Fixture $fixture) + { + $testingEnvironment = $fixture->getTestEnvironment(); + + $optionsToOverride = array( + 'dbname' => $fixture->getDbName(), + 'host' => $input->getOption('db-host'), + 'username' => $input->getOption('db-user'), + 'password' => $input->getOption('db-pass') + ); + foreach ($optionsToOverride as $configOption => $value) { + if ($value) { + $configOverride = $testingEnvironment->configOverride; + $configOverride['database_tests'][$configOption] = $configOverride['database'][$configOption] = $value; + $testingEnvironment->configOverride = $configOverride; + + Config::getInstance()->database[$configOption] = $value; + } + } + } + + private function createFixture(InputInterface $input) + { $fixtureClass = $input->getArgument('fixture'); if (class_exists("Piwik\\Tests\\Fixtures\\" . $fixtureClass)) { $fixtureClass = "Piwik\\Tests\\Fixtures\\" . $fixtureClass; @@ -93,7 +180,6 @@ class TestsSetupFixture extends ConsoleCommand throw new \Exception("Cannot find fixture class '$fixtureClass'."); } - // create the fixture $fixture = new $fixtureClass(); $fixture->printToScreen = true; @@ -115,52 +201,16 @@ class TestsSetupFixture extends ConsoleCommand $fixture->extraPluginsToLoad = explode(',', $extraPluginsToLoad); } - if($fixture->createConfig) { + if ($fixture->createConfig) { Config::getInstance()->setTestEnvironment(); } - $fixture->createConfig = false; - - // setup database overrides - $testingEnvironment = $fixture->getTestEnvironment(); - - $optionsToOverride = array( - 'dbname' => $fixture->getDbName(), - 'host' => $input->getOption('db-host'), - 'user' => $input->getOption('db-user'), - 'password' => $input->getOption('db-pass') - ); - foreach ($optionsToOverride as $configOption => $value) { - if ($value) { - $configOverride = $testingEnvironment->configOverride; - $configOverride['database_tests'][$configOption] = $configOverride['database'][$configOption] = $value; - $testingEnvironment->configOverride = $configOverride; - Config::getInstance()->database[$configOption] = $value; - } - } - - // perform setup and/or teardown - if ($input->getOption('teardown')) { - $testingEnvironment->save(); - $fixture->performTearDown(); - } else { - $fixture->performSetUp(); - } - - if ($input->getOption('set-phantomjs-symlinks')) { - // make sure symbolic links exist (phantomjs doesn't support symlink-ing yet) - foreach (array('libs', 'plugins', 'tests', 'piwik.js') as $linkName) { - $linkPath = PIWIK_INCLUDE_PATH . '/tests/PHPUnit/proxy/' . $linkName; - if (!file_exists($linkPath)) { - symlink(PIWIK_INCLUDE_PATH . '/' . $linkName, $linkPath); - } - } - } + $fixture->createConfig = false; - $this->writeSuccessMessage($output, array("Fixture successfully setup!")); + return $fixture; } - private function requireFixtureFiles() + private function requireFixtureFiles(InputInterface $input) { require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php'; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/FakeAccess.php'; @@ -180,6 +230,17 @@ class TestsSetupFixture extends ConsoleCommand require_once $file; } } + + $file = $input->getOption('file'); + if ($file) { + if (is_file($file)) { + require_once $file; + } else if (is_file(PIWIK_INCLUDE_PATH . '/' . $file)) { + require_once PIWIK_INCLUDE_PATH . '/' . $file; + } else { + throw new \Exception("Cannot find --file option file '$file'."); + } + } } private function setIncludePathAsInTestBootstrap() diff --git a/plugins/CoreHome/angularjs/anchorLinkFix.js b/plugins/CoreHome/angularjs/anchorLinkFix.js index 9764d362ba210dc499243f57928a2fac4661ca1c..59d8114a568272eb401bf5044d4edc489cd190b8 100644 --- a/plugins/CoreHome/angularjs/anchorLinkFix.js +++ b/plugins/CoreHome/angularjs/anchorLinkFix.js @@ -6,7 +6,7 @@ */ /** - * See http://dev.piwik.org/trac/ticket/4795 "linking to #hash tag does not work after merging AngularJS" + * See https://github.com/piwik/piwik/issues/4795 "linking to #hash tag does not work after merging AngularJS" */ (function () { diff --git a/plugins/CoreHome/javascripts/dataTable_rowactions.js b/plugins/CoreHome/javascripts/dataTable_rowactions.js index b5e7140b8e6b2b10c08cb48234604debca518194..4d717938ab0e9718ec37e59e1f9fdd59a3c631e1 100644 --- a/plugins/CoreHome/javascripts/dataTable_rowactions.js +++ b/plugins/CoreHome/javascripts/dataTable_rowactions.js @@ -215,11 +215,9 @@ DataTable_RowAction.prototype.getLabelFromTr = function (tr) { value = value.trim(); value = encodeURIComponent(value); - // if tr is a terminal node, we add a '%20' to signfy this. Piwik will notice this and make sure to - // look for a terminal, even if there's a sibling branch node w/ the same label. this is a workaround - // for #4363. + // if tr is a terminal node, we use the @ operator to distinguish it from branch nodes w/ the same name if (!tr.hasClass('subDataTable')) { - value = value + '%20'; + value = '@' + value; } return value; diff --git a/plugins/CoreHome/stylesheets/cloud.less b/plugins/CoreHome/stylesheets/cloud.less index fc71f9650ddfcef7a25d06a5df95e539606f31e1..a0750c6497fc7dea7ed2b5652db08543891cae33 100644 --- a/plugins/CoreHome/stylesheets/cloud.less +++ b/plugins/CoreHome/stylesheets/cloud.less @@ -1,6 +1,6 @@ @-moz-document url-prefix() { // see bug in Firefox 30+ - // http://dev.piwik.org/trac/ticket/5242 + // https://github.com/piwik/piwik/issues/5242 // https://bugzilla.mozilla.org/show_bug.cgi?id=1012640 .tagCloud + .dataTableFeatures { clear: left; diff --git a/plugins/CustomAlerts b/plugins/CustomAlerts index defaa73836af7da37bff85c74de336ff6b1edcdd..f3d046a6949bdeee8974d5b8293f7e7cf1533c24 160000 --- a/plugins/CustomAlerts +++ b/plugins/CustomAlerts @@ -1 +1 @@ -Subproject commit defaa73836af7da37bff85c74de336ff6b1edcdd +Subproject commit f3d046a6949bdeee8974d5b8293f7e7cf1533c24 diff --git a/plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php b/plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php index b72ded9a0edab206c2f315d30dec2e2116ff9103..2a3e6a8ae5e83113c23ff8728aa2258354840859 100644 --- a/plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php +++ b/plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php @@ -8,12 +8,14 @@ namespace Piwik\Plugins\CustomVariables\tests; +use Piwik\Tests\IntegrationTestCase; + /** * @group CustomVariables * @group CustomVariablesTest * @group Database */ -class CustomVariablesIntegrationTest extends \IntegrationTestCase +class CustomVariablesIntegrationTest extends IntegrationTestCase { /** * @var Fixtures\VisitWithManyCustomVariables diff --git a/plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php b/plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php index 11ca6052979a08b9d9a4ebfb141186f73e8f203b..8060eb25a77e0002b6a2182d6df0baff318ed9ef 100644 --- a/plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php +++ b/plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php @@ -9,11 +9,12 @@ namespace Piwik\Plugins\CustomVariables\tests\Fixtures; use Piwik\Plugins\CustomVariables\Model; use Piwik\Plugins\Goals\API; +use Piwik\Tests\Fixture; /** * Adds one site with two goals and tracks two visits with custom variables. */ -class VisitWithManyCustomVariables extends \Fixture +class VisitWithManyCustomVariables extends Fixture { public $dateTime = '2010-01-03 11:22:33'; public $idSite = 1; diff --git a/plugins/ExampleAPI/API.php b/plugins/ExampleAPI/API.php index f7cb0424cea48e69e7f3123879bd5f9723459395..63e66fac9bac8bd5c308307b9dc47a106aa1e4fa 100644 --- a/plugins/ExampleAPI/API.php +++ b/plugins/ExampleAPI/API.php @@ -16,7 +16,7 @@ use Piwik\Version; /** * The ExampleAPI is useful to developers building a custom Piwik plugin. * - * Please see the <a href='http://dev.piwik.org/trac/browser/trunk/plugins/ExampleAPI/API.php#L1' target='_blank'>source code in in the file plugins/ExampleAPI/API.php</a> for more documentation. + * Please see the <a href='https://github.com/piwik/piwik/blob/master/plugins/ExampleAPI/API.php' target='_blank'>source code in in the file plugins/ExampleAPI/API.php</a> for more documentation. * @method static \Piwik\Plugins\ExampleAPI\API getInstance() */ class API extends \Piwik\Plugin\API @@ -28,7 +28,6 @@ class API extends \Piwik\Plugin\API public function getPiwikVersion() { Piwik::checkUserHasSomeViewAccess(); - Piwik::checkUserIsNotAnonymous(); return Version::VERSION; } diff --git a/plugins/ExamplePlugin/tests/SimpleIntegrationTest.php b/plugins/ExamplePlugin/tests/SimpleIntegrationTest.php index 3debdd9829dc2335da5e8161febb7dbc3dd15d02..f9cebb8c728c70cfb9a2c96f391d7ecf87c124cb 100644 --- a/plugins/ExamplePlugin/tests/SimpleIntegrationTest.php +++ b/plugins/ExamplePlugin/tests/SimpleIntegrationTest.php @@ -7,14 +7,16 @@ */ namespace Piwik\Plugins\ExamplePlugin\tests; + use Piwik\Plugins\ExamplePlugin\tests\fixtures\SimpleFixtureTrackFewVisits; +use Piwik\Tests\IntegrationTestCase; /** * @group ExamplePlugin * @group SimpleIntegrationTest * @group Plugins */ -class SimpleIntegrationTest extends \IntegrationTestCase +class SimpleIntegrationTest extends IntegrationTestCase { /** * @var SimpleFixtureTrackFewVisits @@ -59,5 +61,4 @@ class SimpleIntegrationTest extends \IntegrationTestCase } -SimpleIntegrationTest::$fixture = new SimpleFixtureTrackFewVisits(); - +SimpleIntegrationTest::$fixture = new SimpleFixtureTrackFewVisits(); \ No newline at end of file diff --git a/plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php b/plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php index 40aff52ad80a01090a034b8e4ede38002c5b3af4..f0515abfb187d399695f0d97574954e6acc29f6e 100644 --- a/plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php +++ b/plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php @@ -8,13 +8,14 @@ namespace Piwik\Plugins\ExamplePlugin\tests\fixtures; use Piwik\Date; +use Piwik\Tests\Fixture; /** * Generates tracker testing data for our SimpleIntegrationTest * * This Simple fixture adds one website and tracks one visit with couple pageviews and an ecommerce conversion */ -class SimpleFixtureTrackFewVisits extends \Fixture +class SimpleFixtureTrackFewVisits extends Fixture { public $dateTime = '2013-01-23 01:23:45'; public $idSite = 1; @@ -75,6 +76,4 @@ class SimpleFixtureTrackFewVisits extends \Fixture self::checkResponse($t->doTrackEcommerceCartUpdate($grandTotal = 33 * 77)); } - -} - +} \ No newline at end of file diff --git a/plugins/Feedback/templates/index.twig b/plugins/Feedback/templates/index.twig index dba9db49d4d31e16adb9b0a4ac3df0dc9cd0632d..e72ad2a5dadedd724982343d09c9913564a8e586 100644 --- a/plugins/Feedback/templates/index.twig +++ b/plugins/Feedback/templates/index.twig @@ -37,16 +37,14 @@ <h2>{{ 'Feedback_DoYouHaveBugReportOrFeatureRequest'|translate }}</h2> <div class="header_full"> - <p>{{ 'Feedback_HowToCreateIssue'|translate( + <p>{{ 'Feedback_HowToCreateTicket'|translate( "<a target='_blank' href='?module=Proxy&action=redirect&url=http://developer.piwik.org/guides/core-team-workflow%23submitting-a-bug-report'>", "</a>", "<a target='_blank' href='?module=Proxy&action=redirect&url=http://developer.piwik.org/guides/core-team-workflow%23submitting-a-feature-request'>", "</a>", - "<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/register'>", + "<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues'>", "</a>", - "<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/login'>", - "</a>", - "<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/newticket'>", + "<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/new'>", "</a>" )|raw }}</p> <br/> diff --git a/plugins/ImageGraph/StaticGraph/GridGraph.php b/plugins/ImageGraph/StaticGraph/GridGraph.php index b136f80ed025875f01aa36e486102e05457c283c..3eeb1393db470a920c7d2779ddabb85e8a4d3235 100644 --- a/plugins/ImageGraph/StaticGraph/GridGraph.php +++ b/plugins/ImageGraph/StaticGraph/GridGraph.php @@ -416,7 +416,7 @@ abstract class GridGraph extends StaticGraph // can not currently be used because pChart's label design is not flexible enough // e.g: it is not possible to remove the box border & the square icon // it would require modifying pChart code base which we try to avoid - // see http://dev.piwik.org/trac/ticket/3396 + // see https://github.com/piwik/piwik/issues/3396 // protected function displayMinMaxValues() // { // if($displayMinMax) diff --git a/plugins/Insights/tests/ApiTest.php b/plugins/Insights/tests/ApiTest.php index 3dfcf47a64d223f10675812c1c7d6c7f8ce6fa3f..e769252e9d13545d2115463908a717af5fb0a2dc 100644 --- a/plugins/Insights/tests/ApiTest.php +++ b/plugins/Insights/tests/ApiTest.php @@ -12,6 +12,7 @@ use Piwik\DataTable; use Piwik\DataTable\Row; use Piwik\Plugins\Insights\API; use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays; +use Piwik\Tests\IntegrationTestCase; /** * @group Insights @@ -19,7 +20,7 @@ use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays; * @group Database * @group Plugins */ -class ApiTest extends \IntegrationTestCase +class ApiTest extends IntegrationTestCase { /** * @var SomeVisitsDifferentPathsOnTwoDays @@ -40,13 +41,13 @@ class ApiTest extends \IntegrationTestCase } /** - '/Mover1' => 2, +8 // 400% - '/Old1' => 9, -9 // -100% - '/Mover2' => 24, -11 // -50% - '/Mover3' => 21, -1 // -5% - '/Old2' => 3 -3 // -100% - '/New1', +5 // 100% - '/New2' +2 // 100% + * '/Mover1' => 2, +8 // 400% + * '/Old1' => 9, -9 // -100% + * '/Mover2' => 24, -11 // -50% + * '/Mover3' => 21, -1 // -5% + * '/Old2' => 3 -3 // -100% + * '/New1', +5 // 100% + * '/New2' +2 // 100% */ public function test_getInsights_ShouldReturnCorrectMetadata() { diff --git a/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php b/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php index a665a06d96c484517f489f0e883c9f22e84417bc..c5314d3aa3d4d27be9d231e52df1ee3f591d5a2e 100644 --- a/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php +++ b/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php @@ -9,12 +9,13 @@ namespace Piwik\Plugins\Insights\tests\Fixtures; use Piwik\Date; +use Piwik\Tests\Fixture; /** * Adds one website and tracks several visits from one visitor on * different days that span about a month apart. */ -class SomeVisitsDifferentPathsOnTwoDays extends \Test_Piwik_BaseFixture +class SomeVisitsDifferentPathsOnTwoDays extends Fixture { public $idSite = 1; public $date1 = '2010-12-14'; @@ -75,6 +76,5 @@ class SomeVisitsDifferentPathsOnTwoDays extends \Test_Piwik_BaseFixture $numPageViews++; } } - } -} +} \ No newline at end of file diff --git a/plugins/Insights/tests/ModelTest.php b/plugins/Insights/tests/ModelTest.php index 1dd70150ee3803870941bd15b69a0c5ba8fadc07..12bd28394941ebcefb36e56c31e989eecd3a68f8 100644 --- a/plugins/Insights/tests/ModelTest.php +++ b/plugins/Insights/tests/ModelTest.php @@ -11,6 +11,7 @@ namespace Piwik\Plugins\Insights\tests; use Piwik\DataTable; use Piwik\Plugins\Insights\Model; use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays; +use Piwik\Tests\IntegrationTestCase; /** * @group Insights @@ -18,7 +19,7 @@ use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays; * @group Database * @group Plugins */ -class ModelTest extends \IntegrationTestCase +class ModelTest extends IntegrationTestCase { /** * @var SomeVisitsDifferentPathsOnTwoDays diff --git a/plugins/Live/javascripts/visitorLog.js b/plugins/Live/javascripts/visitorLog.js index 0b5f8fefbbafa24bba5a28484ac268d4639bfb84..3f30f9e9ab0eddaaa46c221fbeb96b65adc8693b 100644 --- a/plugins/Live/javascripts/visitorLog.js +++ b/plugins/Live/javascripts/visitorLog.js @@ -64,7 +64,7 @@ var tooltipIsOpened = false; $('a', $this).on('focus', function () { - // see http://dev.piwik.org/trac/ticket/4099 + // see https://github.com/piwik/piwik/issues/4099 if (tooltipIsOpened) { $this.tooltip('close'); } diff --git a/plugins/MultiSites/angularjs/dashboard/dashboard-model.js b/plugins/MultiSites/angularjs/dashboard/dashboard-model.js index 802e1dfe8fd03361fccdcfcaba8fbb7c71840efd..52c66bd6873503cb21c48882654e42d145ae9ef6 100644 --- a/plugins/MultiSites/angularjs/dashboard/dashboard-model.js +++ b/plugins/MultiSites/angularjs/dashboard/dashboard-model.js @@ -97,7 +97,7 @@ angular.module('piwikApp').factory('multisitesDashboardModel', function (piwikAp site.idsite = reportMetadata[index].idsite; site.group = reportMetadata[index].group; site.main_url = reportMetadata[index].main_url; - // casting evolution to int fixes sorting, see: http://dev.piwik.org/trac/ticket/4885 + // casting evolution to int fixes sorting, see: https://github.com/piwik/piwik/issues/4885 site.visits_evolution = parseInt(site.visits_evolution, 10); site.pageviews_evolution = parseInt(site.pageviews_evolution, 10); site.revenue_evolution = parseInt(site.revenue_evolution, 10); diff --git a/plugins/Transitions/javascripts/transitions.js b/plugins/Transitions/javascripts/transitions.js index eef37f43202c5e1175988f40016a7f73f819bf5d..174bce24742aa3f43dc4355b506d261212659e3b 100644 --- a/plugins/Transitions/javascripts/transitions.js +++ b/plugins/Transitions/javascripts/transitions.js @@ -46,11 +46,12 @@ DataTable_RowActions_Transitions.prototype.trigger = function (tr, e, subTableLa } }; -DataTable_RowAction.prototype.performAction = function (label, tr, e) { +DataTable_RowActions_Transitions.prototype.performAction = function (label, tr, e) { var separator = ' > '; // LabelFilter::SEPARATOR_RECURSIVE_LABEL var labelParts = label.split(separator); for (var i = 0; i < labelParts.length; i++) { - labelParts[i] = $.trim(decodeURIComponent(labelParts[i])); + var labelPart = labelParts[i].replace('@', ''); + labelParts[i] = $.trim(decodeURIComponent(labelPart)); } label = labelParts.join(piwik.config.action_url_category_delimiter); this.openPopover('title:' + label); diff --git a/tests/PHPUnit/ConsoleCommandTestCase.php b/tests/PHPUnit/ConsoleCommandTestCase.php index 4ff21b4cafde8aaf74c0d7522b42f716fc9cf5af..504d37da95f6e20c3849caebf6824fccc2a5e64b 100644 --- a/tests/PHPUnit/ConsoleCommandTestCase.php +++ b/tests/PHPUnit/ConsoleCommandTestCase.php @@ -33,7 +33,7 @@ use Symfony\Component\Console\Tester\ApplicationTester; * // other checks * } */ -class ConsoleCommandTestCase extends \IntegrationTestCase +class ConsoleCommandTestCase extends IntegrationTestCase { protected $applicationTester = null; diff --git a/tests/PHPUnit/Core/DateTest.php b/tests/PHPUnit/Core/DateTest.php index 436b27ef59a354e6598812fb8f4cbd87d41e4a7c..f208e90c2869b00b4a979ba92896c809d86522dd 100644 --- a/tests/PHPUnit/Core/DateTest.php +++ b/tests/PHPUnit/Core/DateTest.php @@ -61,8 +61,8 @@ class DateTest extends PHPUnit_Framework_TestCase $this->assertEquals($dateExpected->getDatetime(), $date->getDatetime()); // Congo is in UTC+1 all year long (no DST) - $date = Date::factory('now', 'Africa/Brazzaville'); $dateExpected = Date::factory('now')->addHour(1); + $date = Date::factory('now', 'Africa/Brazzaville'); $this->assertEquals($dateExpected->getDatetime(), $date->getDatetime()); // yesterday same time in Congo is the same as today in Congo - 24 hours diff --git a/tests/PHPUnit/Core/ReleaseCheckListTest.php b/tests/PHPUnit/Core/ReleaseCheckListTest.php index 67dc9efe289b42e6d4f263dd028bc72339693ede..97aeace84a78700227bff29574f445d137095e4b 100644 --- a/tests/PHPUnit/Core/ReleaseCheckListTest.php +++ b/tests/PHPUnit/Core/ReleaseCheckListTest.php @@ -306,7 +306,7 @@ class ReleaseCheckListTest extends PHPUnit_Framework_TestCase public function testPiwikJavaScript() { // check source against Snort rule 8443 - // @see http://dev.piwik.org/trac/ticket/2203 + // @see https://github.com/piwik/piwik/issues/2203 $pattern = '/\x5b\x5c{2}.*\x5c{2}[\x22\x27]/'; $contents = file_get_contents(PIWIK_DOCUMENT_ROOT . '/js/piwik.js'); diff --git a/tests/PHPUnit/Core/ServeStaticFileTest.php b/tests/PHPUnit/Core/ServeStaticFileTest.php index dd872cfae6a9f5ac58cc949ba976cb7065ab72d9..ef65358d6baa93c54360fea6457417ff3e0bed1e 100644 --- a/tests/PHPUnit/Core/ServeStaticFileTest.php +++ b/tests/PHPUnit/Core/ServeStaticFileTest.php @@ -15,6 +15,7 @@ use Piwik\ProxyHttp; use Piwik\SettingsServer; +use Piwik\Tests\Fixture; define("TEST_FILE_LOCATION", realpath(dirname(__FILE__) . "/../../resources/lipsum.txt")); define("TEST_FILE_CONTENT_TYPE", "text/plain"); diff --git a/tests/PHPUnit/DatabaseTestCase.php b/tests/PHPUnit/DatabaseTestCase.php index 123f01acaa6cb51e384a0b90b7e843690466d64c..21d695e75138ca9e597ea9fd2cd6ded7f187e843 100644 --- a/tests/PHPUnit/DatabaseTestCase.php +++ b/tests/PHPUnit/DatabaseTestCase.php @@ -6,6 +6,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ use Piwik\Db; +use Piwik\Tests\Fixture; /** * Tests extending DatabaseTestCase are much slower to run: the setUp will diff --git a/tests/PHPUnit/FakeAccess.php b/tests/PHPUnit/FakeAccess.php index 7f652f0ae542a926a369455a9f81387ea934323d..d576da702f5a1210f5ee0aa3ce0fbf8f73e2ac08 100644 --- a/tests/PHPUnit/FakeAccess.php +++ b/tests/PHPUnit/FakeAccess.php @@ -169,5 +169,4 @@ class FakeAccess } return $result; } - -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixture.php b/tests/PHPUnit/Fixture.php index e68ff787e95243109570008657365cd8a114dc40..b12516136d68cb4ab79cdb1e271769433a256639 100644 --- a/tests/PHPUnit/Fixture.php +++ b/tests/PHPUnit/Fixture.php @@ -5,6 +5,8 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests; + use Piwik\Access; use Piwik\Common; use Piwik\Config; @@ -29,6 +31,11 @@ use Piwik\Site; use Piwik\Tracker\Cache; use Piwik\Translate; use Piwik\Url; +use PHPUnit_Framework_Assert; +use Piwik_TestingEnvironment; +use FakeAccess; +use PiwikTracker; +use Piwik_LocalTracker; use Piwik\Updater; use Piwik\Plugins\CoreUpdater\CoreUpdater; @@ -794,15 +801,35 @@ class Fixture extends PHPUnit_Framework_Assert } return $result; } -} -// TODO: remove when other plugins don't use BaseFixture -class Test_Piwik_BaseFixture extends Fixture -{ + public static function updateDatabase($force = false) + { + if ($force) { + // remove version options to force update + Option::deleteLike('version%'); + Option::set('version_core', '0.0'); + } + + $updater = new Updater(); + $componentsWithUpdateFile = CoreUpdater::getComponentUpdates($updater); + if (empty($componentsWithUpdateFile)) { + return false; + } + + $result = CoreUpdater::updateComponents($updater, $componentsWithUpdateFile); + if (!empty($result['coreError']) + || !empty($result['warnings']) + || !empty($result['errors']) + ) { + throw new \Exception("Failed to update database (errors or warnings found): " . print_r($result, true)); + } + + return $result; + } } // needed by tests that use stored segments w/ the proxy index.php -class Test_Access_OverrideLogin extends Access +class OverrideLogin extends Access { public function getLogin() { diff --git a/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php b/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php index ab5e02a7ed9c48766dfaed135f969b35746efc00..8d895228b4309b98720f42141b6fe97c4a3e837f 100644 --- a/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php +++ b/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php @@ -5,13 +5,18 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Tracker\Visit; +use Piwik\Tests\Fixture; +use PiwikTracker; +use Exception; /** * Adds one site and tracks a couple visits using a custom visitor ID. */ -class Test_Piwik_Fixture_FewVisitsWithSetVisitorId extends Fixture +class FewVisitsWithSetVisitorId extends Fixture { public $idSite = 1; public $dateTime = '2010-03-06 11:22:33'; @@ -87,4 +92,4 @@ class Test_Piwik_Fixture_FewVisitsWithSetVisitorId extends Fixture //OK } } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/InvalidVisits.php b/tests/PHPUnit/Fixtures/InvalidVisits.php index 75015a0766966b8d8327b7099bd49399e24323d5..adf068d5d33c19cd63fdd3ab9b7a7cceaf18ae87 100644 --- a/tests/PHPUnit/Fixtures/InvalidVisits.php +++ b/tests/PHPUnit/Fixtures/InvalidVisits.php @@ -5,14 +5,18 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Http; use Piwik\Plugins\SitesManager\API; +use Piwik\Tests\Fixture; +use Exception; /** * Adds one site and sends several invalid tracking requests. The result should be * one website with no visits. */ -class Test_Piwik_Fixture_InvalidVisits extends Fixture +class InvalidVisits extends Fixture { public $idSite = 1; public $dateTime = '2009-01-04 00:11:42'; @@ -107,4 +111,4 @@ class Test_Piwik_Fixture_InvalidVisits extends Fixture $t->setAttributionInfo(json_encode(array())); } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php b/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php index a43d12661d44d260b1d441d395561235622f0e80..33e13f7999b6ef72a9b5bbf243f9a4ad06e97b4b 100644 --- a/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php +++ b/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php @@ -5,16 +5,20 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Access; use Piwik\Plugins\Goals\API as APIGoals; use Piwik\Plugins\SegmentEditor\API as APISegmentEditor; use Piwik\Plugins\UserCountry\LocationProvider\GeoIp; use Piwik\Plugins\UserCountry\LocationProvider; +use Piwik\Tests\Fixture; +use Piwik\Tests\OverrideLogin; /** * Imports visits from several log files using the python log importer. */ -class Test_Piwik_Fixture_ManySitesImportedLogs extends Fixture +class ManySitesImportedLogs extends Fixture { public $dateTime = '2012-08-09 11:22:33'; public $idSite = 1; @@ -26,7 +30,7 @@ class Test_Piwik_Fixture_ManySitesImportedLogs extends Fixture public static function createAccessInstance() { - Access::setSingletonInstance($access = new Test_Access_OverrideLogin()); + Access::setSingletonInstance($access = new OverrideLogin()); \Piwik\Piwik::postEvent('Request.initAuthenticationObject'); } @@ -47,7 +51,7 @@ class Test_Piwik_Fixture_ManySitesImportedLogs extends Fixture { LocationProvider::$providers = null; GeoIp::$geoIPDatabaseDir = 'tests/lib/geoip-files'; - Test_Piwik_Fixture_ManyVisitsWithGeoIP::unsetLocationProvider(); + ManyVisitsWithGeoIP::unsetLocationProvider(); } public function setUpWebsitesAndGoals() @@ -225,5 +229,4 @@ class Test_Piwik_Fixture_ManySitesImportedLogs extends Fixture self::executeLogImporter($logFile, $opts); } - -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php b/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php index 83695ef5316238d889f38760ae4bd8974983a9d3..4ed24f85737baa9c3ea0c5f52e6c3eaa2d5cd5c9 100644 --- a/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php +++ b/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php @@ -5,10 +5,13 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Db; use Piwik\Plugins\Annotations\API as APIAnnotations; use Piwik\Plugins\Goals\API as APIGoals; +use Piwik\Tests\Fixture; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php'; @@ -16,7 +19,7 @@ require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Fixtures/ManySitesImportedLogs * Imports visits from several log files using the python log importer & * adds goals/sites/etc. attempting to create XSS. */ -class Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts extends Test_Piwik_Fixture_ManySitesImportedLogs +class ManySitesImportedLogsWithXssAttempts extends ManySitesImportedLogs { public $now = null; @@ -117,4 +120,4 @@ class Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts extends Test_Piwik $t->setLongitude(-46.64); self::checkResponse($t->doTrackPageView('incredible title!')); } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php index e938edb86ccafcc5e7ccfc73ffd943ab21b1bc9e..3e064ae095af23bff80122a57b30098dac31dc77 100644 --- a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php +++ b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php @@ -5,11 +5,14 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; use Piwik\Date; use Piwik\Plugins\Goals\API; use Piwik\Plugins\UserCountry\LocationProvider\GeoIp; use Piwik\Plugins\UserCountry\LocationProvider; +use Piwik\Tests\Fixture; +use Exception; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php'; @@ -17,7 +20,7 @@ require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php'; * Adds one new website and tracks 35 visits from 18 visitors with geolocation using * free GeoIP databases. The GeoIP databases are downloaded if they do not exist already. */ -class Test_Piwik_Fixture_ManyVisitsWithGeoIP extends Fixture +class ManyVisitsWithGeoIP extends Fixture { const GEOIP_IMPL_TO_TEST = 'geoip_php'; @@ -207,7 +210,7 @@ class Test_Piwik_Fixture_ManyVisitsWithGeoIP extends Fixture { LocationProvider::$providers = null; LocationProvider::setCurrentProvider('mock_provider'); - MockLocationProvider::$locations = array( + \MockLocationProvider::$locations = array( self::makeLocation('Stratford-upon-Avon', 'P3', 'gb', 123.456, 21.321), // template location // same region, different city, same country @@ -251,5 +254,4 @@ class Test_Piwik_Fixture_ManyVisitsWithGeoIP extends Fixture // ignore error } } - -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php b/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php index ebbaf380f385832d6d655f8efa11d413c118f26b..b53d88d25fb4144a7515598c0f409966493771dc 100644 --- a/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php +++ b/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php @@ -5,16 +5,18 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; use Piwik\Date; use Piwik\Plugins\UserCountry\LocationProvider; +use Piwik\Tests\Fixture; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php'; /** * Adds one site and tracks 60 visits (15 visitors, one action per visit). */ -class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Fixture +class ManyVisitsWithMockLocationProvider extends Fixture { public $idSite = 1; public $dateTime = '2010-01-03 01:22:33'; @@ -34,7 +36,7 @@ class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Fixture public function tearDown() { - Test_Piwik_Fixture_ManyVisitsWithGeoIP::unsetLocationProvider(); + ManyVisitsWithGeoIP::unsetLocationProvider(); } private function setUpWebsitesAndGoals() @@ -208,7 +210,7 @@ class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Fixture private function setMockLocationProvider() { LocationProvider::setCurrentProvider('mock_provider'); - MockLocationProvider::$locations = array( + \MockLocationProvider::$locations = array( self::makeLocation('Toronto', 'ON', 'CA', $lat = null, $long = null, $isp = 'comcast.net'), self::makeLocation('Nice', 'B8', 'FR', $lat = null, $long = null, $isp = 'comcast.net'), @@ -218,5 +220,4 @@ class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Fixture self::makeLocation('Yokohama', '19', 'JP'), ); } - -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php b/tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php index 95eddf823fa8ca0f806f9adfdc2767c42670ef89..88f673831c2be77048224eaca00c83e293db31e9 100644 --- a/tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php +++ b/tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php @@ -5,14 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -# +namespace Piwik\Tests\Fixtures; + use Piwik\Date; +use Piwik\Tests\Fixture; /** * Adds one site and tracks 13 visits all with custom variables and referrer URLs * w/ sub-dirs (ie, /path/to/page/has/many/dirs.htm). */ -class Test_Piwik_Fixture_ManyVisitsWithSubDirReferrersAndCustomVars extends Fixture +class ManyVisitsWithSubDirReferrersAndCustomVars extends Fixture { public $dateTime = '2010-03-05 11:22:33'; public $idSite = 1; @@ -65,4 +67,4 @@ class Test_Piwik_Fixture_ManyVisitsWithSubDirReferrersAndCustomVars extends Fixt $t->setUrl('http://example.org/page1.html'); self::checkResponse($t->doTrackPageView('title')); } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/OmniFixture.php b/tests/PHPUnit/Fixtures/OmniFixture.php index 0de39fd69f7b13d6281f8610deceb02e909d7504..406deb77bc0204d189b3d6bf771544fdce66310d 100644 --- a/tests/PHPUnit/Fixtures/OmniFixture.php +++ b/tests/PHPUnit/Fixtures/OmniFixture.php @@ -8,13 +8,18 @@ namespace Piwik\Tests\Fixtures; use Piwik\Date; +use Piwik\Access; +use Piwik\Option; use ReflectionClass; +use Piwik\Plugins\VisitsSummary\API as VisitsSummaryAPI; +use Piwik\Tests\Fixture; +use Piwik\Tests\OverrideLogin; /** * This fixture is the combination of every other fixture defined by Piwik. Should be used * with year periods. */ -class OmniFixture extends \Fixture +class OmniFixture extends Fixture { public $month = '2012-01'; public $idSite = 'all'; @@ -42,10 +47,11 @@ class OmniFixture extends \Fixture && $className != __CLASS__ && $className != "Piwik_Test_Fixture_SqlDump" && $className != "Piwik\\Tests\\Fixtures\\UpdaterTestFixture" + && $className != "Piwik\\Tests\\Fixtures\\UITestFixture" ) { $klassReflect = new ReflectionClass($className); if (!strpos($klassReflect->getFilename(), "tests/PHPUnit/Fixtures") - && $className != "Test_Piwik_Fixture_CustomAlerts" + && $className != "CustomAlerts" && $className != "Piwik\\Plugins\\Insights\\tests\\Fixtures\\SomeVisitsDifferentPathsOnTwoDays" ) { continue; @@ -64,12 +70,12 @@ class OmniFixture extends \Fixture } } - $this->now = $this->fixtures['Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts']->now; + $this->now = $this->fixtures['ManySitesImportedLogsWithXssAttempts']->now; - // make sure Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts is the first fixture - $fixture = $this->fixtures['Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts']; - unset($this->fixtures['Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts']); - $this->fixtures = array_merge(array('Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts' => $fixture), $this->fixtures); + // make sure ManySitesImportedLogsWithXssAttempts is the first fixture + $fixture = $this->fixtures['Piwik\\Tests\\Fixtures\\ManySitesImportedLogsWithXssAttempts']; + unset($this->fixtures['Piwik\\Tests\\Fixtures\\ManySitesImportedLogsWithXssAttempts']); + $this->fixtures = array_merge(array('Piwik\\Tests\\Fixtures\\ManySitesImportedLogsWithXssAttempts' => $fixture), $this->fixtures); } private function adjustDateTime($dateTime, $adjustToDate) @@ -87,6 +93,13 @@ class OmniFixture extends \Fixture foreach ($this->fixtures as $fixture) { $fixture->setUp(); } + + Option::set("Tests.forcedNowTimestamp", $this->now->getTimestamp()); + + // launch archiving so tests don't run out of time + $date = Date::factory($this->dateTime)->toString(); + VisitsSummaryAPI::getInstance()->get($this->idSite, 'year', $date); + VisitsSummaryAPI::getInstance()->get($this->idSite, 'year', $date, urlencode($this->segment)); } public function tearDown() @@ -95,4 +108,10 @@ class OmniFixture extends \Fixture $fixture->tearDown(); } } + + public static function createAccessInstance() + { + Access::setSingletonInstance($access = new OverrideLogin()); + \Piwik\Piwik::postEvent('Request.initAuthenticationObject'); + } } \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php b/tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php index ae0618d5c5f55616c143f0b561519561b22ace95..c4ed1564a057dbd8b47e0abfecf1cb189be6dce9 100644 --- a/tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php +++ b/tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php @@ -5,12 +5,15 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; +use Piwik\Tests\Fixture; /** * Adds one site and tracks one visit with several pageviews. */ -class Test_Piwik_Fixture_OneVisitSeveralPageViews extends Fixture +class OneVisitSeveralPageViews extends Fixture { public $dateTime = '2010-03-06 11:22:33'; public $idSite = 1; @@ -66,16 +69,24 @@ class Test_Piwik_Fixture_OneVisitSeveralPageViews extends Fixture $t->setUrl('http://example.org/dir2/sub/0/file.php'); $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.4)->getDatetime()); - // Very high Generation time should be ignored $t->setGenerationTime(6350000); self::checkResponse($t->doTrackPageView('incredible title! <>,;')); + // visit terminal & branch pages w/ the same name so we can test the ! label filter query operator + $t->setUrl('http://example.org/dir/subdir/'); + $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.41)->getDatetime()); + $t->setGenerationTime(233); + self::checkResponse($t->doTrackPageView('check <> / @one@ / two')); + + $t->setUrl('http://example.org/dir/subdir'); + $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.42)->getDatetime()); + $t->setGenerationTime(333); + self::checkResponse($t->doTrackPageView('check <> / @one@')); $t->setUrl('http://example.org/0'); $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.4)->getDatetime()); $t->setGenerationTime(635); self::checkResponse($t->doTrackPageView('I am URL zero!')); - } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php b/tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php index 0dcacc45a9b6b0fe261d16d369e74f24ef7ebdb7..7a316bcc788d3b1e9f40816f70f693e2000bbe99 100644 --- a/tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php +++ b/tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; +use Piwik\Tests\Fixture; /** * Adds one site and tracks one visit w/ pageview URLs that are not normalized. * These URLs use different protocols and a mix of lowercase & uppercase letters. */ -class Test_Piwik_Fixture_OneVisitWithAbnormalPageviewUrls extends Fixture +class OneVisitWithAbnormalPageviewUrls extends Fixture { public $dateTime = '2010-03-06 11:22:33'; public $idSite = 1; @@ -64,4 +67,4 @@ class Test_Piwik_Fixture_OneVisitWithAbnormalPageviewUrls extends Fixture $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.6)->getDatetime()); self::checkResponse($t->doTrackPageView('incredible.title/')); } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php b/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php index 5626d5e9edaa72beeda4af5cc53c19910a522c67..50f576b33fa395dbc61e89852c115372ea8f0314 100644 --- a/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php +++ b/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php @@ -5,14 +5,17 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Plugins\Goals\API as APIGoals; use Piwik\Plugins\SitesManager\API as APISitesManager; +use Piwik\Tests\Fixture; /** * This fixture adds one website and tracks two visits by one visitor. */ -class Test_Piwik_Fixture_OneVisitorTwoVisits extends Fixture +class OneVisitorTwoVisits extends Fixture { public $idSite = 1; public $idSiteEmptyBis; @@ -175,4 +178,4 @@ class Test_Piwik_Fixture_OneVisitorTwoVisits extends Fixture // - // End of second visit } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php b/tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php index 462fd2a4b2c84e7e957056685d8578bc1465e0a9..74254a586e9d9e03730817804e03a13299167523 100644 --- a/tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php +++ b/tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Plugins\Goals\API; +use Piwik\Tests\Fixture; /** * Adds one site and tracks a couple conversions. */ -class Piwik_Test_Fixture_SomeVisitsAllConversions extends Fixture +class SomeVisitsAllConversions extends Fixture { public $dateTime = '2009-01-04 00:11:42'; public $idSite = 1; @@ -91,4 +94,4 @@ class Piwik_Test_Fixture_SomeVisitsAllConversions extends Fixture $t->setForceNewVisit(); $t->doTrackPageView('This is tracked in a new visit.'); } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php index 6e295b45bad358a4ecac884ba0f1c1921d65f95f..53db8ca2f5e06e6a732272f9454993f88e827a06 100644 --- a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php +++ b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php @@ -5,14 +5,18 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Plugins\Goals\API; +use Piwik\Tests\Fixture; +use PiwikTracker; /** * Add one site and track many visits with custom variables & campaign IDs and * use visit ID instead of heuristics. */ -class Test_Piwik_Fixture_SomeVisitsCustomVariablesCampaignsNotHeuristics extends Fixture +class SomeVisitsCustomVariablesCampaignsNotHeuristics extends Fixture { public $dateTime = '2009-01-04 00:11:42'; public $idSite = 1; @@ -164,4 +168,4 @@ class Test_Piwik_Fixture_SomeVisitsCustomVariablesCampaignsNotHeuristics extends unset($_COOKIE[$refCookieName]); unset($_COOKIE[$customVarCookieName]); } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php b/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php index 01748bb90722b5d7df2aa7b32fc741cfde1e4068..1791b4375088667e89c40ad025ff8118c562641d 100644 --- a/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php +++ b/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; +use Piwik\Tests\Fixture; /** * Adds one site and tracks a couple visits with many pageviews. The * pageviews are designed to have many transitions between pages. */ -class Test_Piwik_Fixture_SomeVisitsManyPageviewsWithTransitions extends Fixture +class SomeVisitsManyPageviewsWithTransitions extends Fixture { public $dateTime = '2010-03-06 11:22:33'; public $idSite = 1; @@ -150,4 +153,4 @@ class Test_Piwik_Fixture_SomeVisitsManyPageviewsWithTransitions extends Fixture self::assertTrue($visit->doTrackEvent($searchCategory, "event name", $searchKeyword, $this->prefixCounter)); } } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php b/tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php index 58f90494c16b5e8c9c009af1e383814983573ed1..6d5e2556b3de6e4df884d73e5f85a622fb7f0f67 100644 --- a/tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php +++ b/tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; +use Piwik\Tests\Fixture; /** * Adds one site and tracks 7 visits w/ some long-ish urls (as page urls and * referrer urls). */ -class Test_Piwik_Fixture_SomeVisitsWithLongUrls extends Fixture +class SomeVisitsWithLongUrls extends Fixture { public $dateTime = '2010-03-06 01:22:33'; public $idSite = 1; @@ -102,4 +105,4 @@ class Test_Piwik_Fixture_SomeVisitsWithLongUrls extends Fixture $t->setUrlReferrer('http://nz.bing.com/images/search?q=+++Kia+ora+++'); self::checkResponse($t->doTrackPageView('incredible title!')); } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php b/tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php index 7dc9d2e9cf37102d6657c7eb01c57ba2ef65e61b..60969e7041c9c1f062039143d93cad665abaeb3f 100644 --- a/tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php +++ b/tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Plugins\SitesManager\API; +use Piwik\Tests\Fixture; /** * Adds one website and some visits with non unicode page titles. */ -class Test_Piwik_Fixture_SomeVisitsWithNonUnicodePageTitles extends Fixture +class SomeVisitsWithNonUnicodePageTitles extends Fixture { public $idSite1 = 1; public $dateTime = '2010-01-03 11:22:33'; @@ -99,4 +102,4 @@ class Test_Piwik_Fixture_SomeVisitsWithNonUnicodePageTitles extends Fixture self::checkResponse($visitor->doTrackPageView('Site Search results')); $visitor->setPageCharset(''); } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/SqlDump.php b/tests/PHPUnit/Fixtures/SqlDump.php index 9113d5e4e7a9e9b109cf6c3bcd887e0b43e55664..7aea83b781bb18ad04c6db98b3332b06b5c208af 100644 --- a/tests/PHPUnit/Fixtures/SqlDump.php +++ b/tests/PHPUnit/Fixtures/SqlDump.php @@ -5,15 +5,19 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\ArchiveProcessor\Rules; use Piwik\Config; use Piwik\Db; use Piwik\Piwik; +use Piwik\Tests\Fixture; +use Exception; /** * Reusable fixture. Loads a SQL dump into the DB. */ -class Piwik_Test_Fixture_SqlDump extends Fixture +class SqlDump extends Fixture { public $date = '2012-09-03'; public $dateTime = '2012-09-03'; diff --git a/tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php b/tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php index 6c4e3183414ebf7cda9bcfe4b507e1457de95b88..ac7abb6a4fc2b80936f3e08d96ce534e56b0bfef 100644 --- a/tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php +++ b/tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php @@ -5,14 +5,17 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Plugins\Goals\API; +use Piwik\Tests\Fixture; /** * Fixture that adds one site with three goals and tracks one pageview & one manual * goal conversion. */ -class Test_Piwik_Fixture_ThreeGoalsOnePageview extends Fixture +class ThreeGoalsOnePageview extends Fixture { public $dateTime = '2009-01-04 00:11:42'; public $idSite = 1; @@ -67,4 +70,4 @@ class Test_Piwik_Fixture_ThreeGoalsOnePageview extends Fixture $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.3)->getDatetime()); self::checkResponse($t->doTrackGoal($this->idGoal3, $revenue = 42.256)); } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php b/tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php index 20c03a585a206d56cc4ae09aef17d50fb869845a..f330218f9a3e574dd346a5946c323da19e05960e 100644 --- a/tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php +++ b/tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php @@ -5,14 +5,17 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Plugins\SitesManager\API; +use Piwik\Tests\Fixture; /** * Adds three websites with different site search configurations and adds * several visits to each of them. */ -class Test_Piwik_Fixture_ThreeSitesWithManyVisitsWithSiteSearch extends Fixture +class ThreeSitesWithManyVisitsWithSiteSearch extends Fixture { public $idSite1 = 1; public $idSite2 = 2; @@ -205,6 +208,4 @@ class Test_Piwik_Fixture_ThreeSitesWithManyVisitsWithSiteSearch extends Fixture $visitor->setUrl('http://example.org/index.htm?' . $crazyTitle); self::checkResponse($visitor->doTrackPageView('Pageview: ' . $crazyTitle)); } - -} - +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php b/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php index 9481cd9f2e0210f82745176def589d4a62817b9a..938fe28c86ffc5848a42a3aa876b7e72e923b419 100644 --- a/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php +++ b/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Plugins\Goals\API; +use Piwik\Tests\Fixture; /** * Adds two sites and tracks some visits with ecommerce orders. */ -class Test_Piwik_Fixture_TwoSitesEcommerceOrderWithItems extends Fixture +class TwoSitesEcommerceOrderWithItems extends Fixture { public $dateTime = '2011-04-05 00:11:42'; public $idSite = 1; @@ -207,9 +210,5 @@ class Test_Piwik_Fixture_TwoSitesEcommerceOrderWithItems extends Fixture $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(30.9)->getDatetime()); $t->addEcommerceItem($sku = 'TRIPOD SKU', $name = 'TRIPOD - bought day after', $category = 'Tools', $price = 100, $quantity = 2); self::checkResponse($t->doTrackEcommerceOrder($orderId = '777', $grandTotal = 250)); - //------------------------------------- End tracking - - } -} - +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php b/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php index 326ca69d663ce4b9e23538f1e705df86568c7c93..3ff7b56fa4d9c214502d4d532bd0dd55df3b48bd 100644 --- a/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php +++ b/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php @@ -5,14 +5,17 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Plugins\Goals\API; +use Piwik\Tests\Fixture; /** * Adds one website and tracks visits on different days over a month * using referrer URLs with search engines. */ -class Test_Piwik_Fixture_TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers extends Fixture +class TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers extends Fixture { public $dateTime = '2010-02-01 11:22:33'; public $idSite = 1; @@ -108,4 +111,4 @@ class Test_Piwik_Fixture_TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferr } self::checkBulkTrackingResponse($t->doBulkTrack()); } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php b/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php index e2df5f8258441c5b9763212e227fc986b969f93d..4caa3e1be728998f41d12814f5a77c602ce7ec72 100644 --- a/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php +++ b/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php @@ -5,14 +5,17 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Plugins\Goals\API as APIGoals; use Piwik\Plugins\SitesManager\API as APISitesManager; +use Piwik\Tests\Fixture; /** * Adds two websites and tracks visits from two visitors on different days. */ -class Test_Piwik_Fixture_TwoSitesTwoVisitorsDifferentDays extends Fixture +class TwoSitesTwoVisitorsDifferentDays extends Fixture { public $idSite1 = 1; public $idSite2 = 2; @@ -179,6 +182,4 @@ class Test_Piwik_Fixture_TwoSitesTwoVisitorsDifferentDays extends Fixture $visitorAsite2->setGenerationTime(503); self::checkResponse($visitorAsite2->doTrackPageView('')); } - -} - +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php b/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php index d5a64150358b810d5c976e2b65770904ed0aa4bc..0d47c97815d046bb8342f80f22d0f855c38efbbc 100644 --- a/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php +++ b/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php @@ -5,12 +5,15 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; +use Piwik\Tests\Fixture; /** * Adds two sites and tracks several visits all in the past. */ -class Test_Piwik_Fixture_TwoSitesVisitsInPast extends Fixture +class TwoSitesVisitsInPast extends Fixture { public $dateTimeFirstDateWebsite1 = '2010-03-06 01:22:33'; public $dateTimeDateInPastWebsite1 = '2010-01-06 01:22:33'; @@ -107,4 +110,4 @@ class Test_Piwik_Fixture_TwoSitesVisitsInPast extends Fixture $t->setUrl('http://example.org/category/Pageyy'); self::checkResponse($t->doTrackPageView('Blabla')); } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php b/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php index 37cb956c512054d1062db559032222f9a998e84e..370c5a864ed42a07e4b9c9bc0e95464efca4bb21 100644 --- a/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php +++ b/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php @@ -5,14 +5,18 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Access; use Piwik\Date; use Piwik\Plugins\Annotations\API; +use Piwik\Tests\Fixture; +use FakeAccess; /** * A fixture that adds two websites and annotations for each website. */ -class Test_Piwik_Fixture_TwoSitesWithAnnotations extends Fixture +class TwoSitesWithAnnotations extends Fixture { public $dateTime = '2011-01-01 00:11:42'; public $idSite1 = 1; @@ -75,4 +79,4 @@ class Test_Piwik_Fixture_TwoSitesWithAnnotations extends Fixture self::createWebsite($this->dateTime, $ecommerce = 1); } } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php b/tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php index de6bb9b2e0cca34401fa2b9cb89724f6926d0d03..eb48a6bd6185f04a8af447ae082b3cfabb5e966d 100644 --- a/tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php +++ b/tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php @@ -5,14 +5,17 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Plugins\Goals\API; +use Piwik\Tests\Fixture; /** * Adds one site and tracks two visits. One visit is a bot and one has no keyword * but is from a search engine. */ -class Test_Piwik_Fixture_TwoVisitsNoKeywordWithBot extends Fixture +class TwoVisitsNoKeywordWithBot extends Fixture { public $dateTime = '2010-03-06 11:22:33'; public $idSite = 1; @@ -66,6 +69,5 @@ class Test_Piwik_Fixture_TwoVisitsNoKeywordWithBot extends Fixture // Test with empty title, that the output of Live is valid self::checkResponse($t->doTrackPageView('')); - } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php b/tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php index 8900eaace2638e577fe15abae4dab03ac4ab8a27..b2777b408f7fd2a3dc9d98c176b1ab0ec265a337 100644 --- a/tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php +++ b/tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php @@ -5,13 +5,17 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Plugins\Goals\API as APIGoals; +use Piwik\Tests\Fixture; +use PiwikTracker; /** * Tracks custom events */ -class Test_Piwik_Fixture_TwoVisitsWithCustomEvents extends Fixture +class TwoVisitsWithCustomEvents extends Fixture { public $dateTime = '2010-01-03 11:22:33'; public $idSite = 1; @@ -186,5 +190,4 @@ class Test_Piwik_Fixture_TwoVisitsWithCustomEvents extends Fixture public function tearDown() { } - -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php b/tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php index ccf0120d7b5259b3e7d3d7c236dcf7234ab397f0..5ed8c06b85f653a934106c55dcf6572c2b0e03c2 100644 --- a/tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php +++ b/tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; use Piwik\Plugins\Goals\API; +use Piwik\Tests\Fixture; /** * Adds one site with two goals and tracks two visits with custom variables. */ -class Test_Piwik_Fixture_TwoVisitsWithCustomVariables extends Fixture +class TwoVisitsWithCustomVariables extends Fixture { public $dateTime = '2010-01-03 11:22:33'; public $idSite = 1; @@ -146,4 +149,4 @@ class Test_Piwik_Fixture_TwoVisitsWithCustomVariables extends Fixture $visitorB->setForceVisitDateTime(Date::factory($dateTime)->addHour(2)->getDatetime()); self::checkResponse($visitorB->doTrackAction('http://test.com', 'link')); } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/UITestFixture.php b/tests/PHPUnit/Fixtures/UITestFixture.php index aeec9eba825fbc3cc28a6971211e4ab92a9560e9..6afbfb2b6d35315204d2507fcd1c11abdc052b3b 100644 --- a/tests/PHPUnit/Fixtures/UITestFixture.php +++ b/tests/PHPUnit/Fixtures/UITestFixture.php @@ -8,8 +8,8 @@ namespace Piwik\Tests\Fixtures; use Exception; -use Piwik\Access; use Piwik\AssetManager; +use Piwik\Access; use Piwik\Common; use Piwik\Date; use Piwik\Db; @@ -17,20 +17,32 @@ use Piwik\DbHelper; use Piwik\FrontController; use Piwik\Option; use Piwik\Plugins\SegmentEditor\API as APISegmentEditor; -use Piwik\Plugins\SitesManager\API as SitesManagerAPI; use Piwik\Plugins\UsersManager\API as UsersManagerAPI; use Piwik\Plugins\VisitsSummary\API as VisitsSummaryAPI; +use Piwik\Plugins\SitesManager\API as SitesManagerAPI; use Piwik\WidgetsList; +use Piwik\Tests\Fixture; +use Piwik\Tests\OverrideLogin; /** * Fixture for UI tests. */ -class UITestFixture extends OmniFixture +class UITestFixture extends SqlDump { + const FIXTURE_LOCATION = '/tests/resources/OmniFixture-dump.sql.gz'; + + public function __construct() + { + $this->dumpUrl = PIWIK_INCLUDE_PATH . self::FIXTURE_LOCATION; + $this->tablesPrefix = ''; + } + public function setUp() { parent::setUp(); + self::updateDatabase(); + // make sure site has an early enough creation date (for period selector tests) Db::get()->update(Common::prefixTable("site"), array('ts_created' => '2011-01-01'), @@ -42,14 +54,6 @@ class UITestFixture extends OmniFixture DbHelper::createAnonymousUser(); UsersManagerAPI::getInstance()->setSuperUserAccess('superUserLogin', true); - - Option::set("Tests.forcedNowTimestamp", $this->now->getTimestamp()); - - // launch archiving so tests don't run out of time - $date = Date::factory($this->dateTime)->toString(); - VisitsSummaryAPI::getInstance()->get($this->idSite, 'year', $date); - VisitsSummaryAPI::getInstance()->get($this->idSite, 'year', $date, urlencode($this->segment)); - SitesManagerAPI::getInstance()->updateSite(1, null, null, true); } @@ -296,7 +300,7 @@ class UITestFixture extends OmniFixture public static function createAccessInstance() { - Access::setSingletonInstance($access = new \Test_Access_OverrideLogin()); + Access::setSingletonInstance($access = new OverrideLogin()); \Piwik\Piwik::postEvent('Request.initAuthenticationObject'); } } \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php b/tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php index 6492ebd1db33c3d2adbdd2c6f14c6ebd6be99a8b..98cc3b50aa26d5539380d728c50f47fc2bcfd809 100644 --- a/tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php +++ b/tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + +use Piwik\Tests\Fixture; /** * Import a same visitor, over three different days, in reverse chronological order * useful to test there are three visits are created for this visitor, as expected * */ -class Test_Piwik_Fixture_VisitOverSeveralDaysImportedLogs extends Fixture +class VisitOverSeveralDaysImportedLogs extends Fixture { public $dateTime = '2013-04-07 19:00:00'; public $idSite = 1; @@ -52,5 +55,4 @@ class Test_Piwik_Fixture_VisitOverSeveralDaysImportedLogs extends Fixture self::executeLogImporter($logFile, $opts); } - -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php b/tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php index f47962e6d732e468fb8aa8b4ecc9f44fbf7ec82d..19c7fcc0624952e7fd69abde53069c0af6ccc020 100644 --- a/tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php +++ b/tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php @@ -5,12 +5,15 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; +use Piwik\Tests\Fixture; /** * Adds one site with a non UTC timezone and tracks a couple visits near the end of the day. */ -class Test_Piwik_Fixture_VisitsInDifferentTimezones extends Fixture +class VisitsInDifferentTimezones extends Fixture { public $idSite = 1; public $dateTime = '2010-03-06'; diff --git a/tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php b/tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php index d0b08c957dcc05bf850ac5b04f5ae9889e7ea119..caf67e00aa58a64d51d1a3b3e977e79d7d92863d 100644 --- a/tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php +++ b/tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Fixtures; + use Piwik\Date; +use Piwik\Tests\Fixture; /** * Adds one website and tracks several visits from one visitor on * different days that span about a month apart. */ -class Test_Piwik_Fixture_VisitsOverSeveralDays extends Fixture +class VisitsOverSeveralDays extends Fixture { public $dateTimes = array( '2010-12-14 01:00:00', @@ -121,4 +124,4 @@ class Test_Piwik_Fixture_VisitsOverSeveralDays extends Fixture $tracker->setDebugStringAppend($debugStringAppend); return $tracker; } -} +} \ No newline at end of file diff --git a/tests/PHPUnit/Integration/AnnotationsTest.php b/tests/PHPUnit/Integration/AnnotationsTest.php index 6257bf7785c9d3cd737b14414cd96479980425da..2dfd150e18c5afa5cc798548d3e31ae5c17fad95 100755 --- a/tests/PHPUnit/Integration/AnnotationsTest.php +++ b/tests/PHPUnit/Integration/AnnotationsTest.php @@ -5,11 +5,20 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; use Piwik\Access; use Piwik\API\Request; use Piwik\Plugins\Annotations\API; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoSitesWithAnnotations; +use FakeAccess; +use Exception; +/** + * @group Integration + * @group AnnotationsTest + */ class AnnotationsTest extends IntegrationTestCase { public static $fixture = null; @@ -80,16 +89,12 @@ class AnnotationsTest extends IntegrationTestCase /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { $this->runApiTests($api, $params); } - /** - * @group Integration - */ public function testAddMultipleSitesFail() { try { @@ -100,9 +105,6 @@ class AnnotationsTest extends IntegrationTestCase } } - /** - * @group Integration - */ public function testAddInvalidDateFail() { try { @@ -113,9 +115,6 @@ class AnnotationsTest extends IntegrationTestCase } } - /** - * @group Integration - */ public function testSaveMultipleSitesFail() { try { @@ -126,9 +125,6 @@ class AnnotationsTest extends IntegrationTestCase } } - /** - * @group Integration - */ public function testSaveInvalidDateFail() { try { @@ -139,9 +135,6 @@ class AnnotationsTest extends IntegrationTestCase } } - /** - * @group Integration - */ public function testSaveInvalidNoteIdFail() { try { @@ -152,9 +145,6 @@ class AnnotationsTest extends IntegrationTestCase } } - /** - * @group Integration - */ public function testDeleteMultipleSitesFail() { try { @@ -165,9 +155,6 @@ class AnnotationsTest extends IntegrationTestCase } } - /** - * @group Integration - */ public function testDeleteInvalidNoteIdFail() { try { @@ -178,9 +165,6 @@ class AnnotationsTest extends IntegrationTestCase } } - /** - * @group Integration - */ public function testGetMultipleSitesFail() { try { @@ -191,9 +175,6 @@ class AnnotationsTest extends IntegrationTestCase } } - /** - * @group Integration - */ public function testGetInvalidNoteIdFail() { try { @@ -204,9 +185,6 @@ class AnnotationsTest extends IntegrationTestCase } } - /** - * @group Integration - */ public function testSaveSuccess() { API::getInstance()->save( @@ -223,9 +201,6 @@ class AnnotationsTest extends IntegrationTestCase $this->assertEquals($expectedAnnotation, API::getInstance()->get(self::$fixture->idSite1, 0)); } - /** - * @group Integration - */ public function testSaveNoChangesSuccess() { API::getInstance()->save(self::$fixture->idSite1, 1); @@ -241,9 +216,6 @@ class AnnotationsTest extends IntegrationTestCase $this->assertEquals($expectedAnnotation, API::getInstance()->get(self::$fixture->idSite1, 1)); } - /** - * @group Integration - */ public function testDeleteSuccess() { API::getInstance()->delete(self::$fixture->idSite1, 1); @@ -287,7 +259,6 @@ class AnnotationsTest extends IntegrationTestCase /** * @dataProvider getPermissionsFailData - * @group Integration */ public function testMethodPermissions($hasAdminAccess, $hasViewAccess, $request, $checkException, $failMessage) { @@ -314,4 +285,4 @@ class AnnotationsTest extends IntegrationTestCase } } -AnnotationsTest::$fixture = new Test_Piwik_Fixture_TwoSitesWithAnnotations(); \ No newline at end of file +AnnotationsTest::$fixture = new TwoSitesWithAnnotations(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/ApiGetReportMetadataTest.php b/tests/PHPUnit/Integration/ApiGetReportMetadataTest.php index c9face05336fc2537982a0b8cfd309387f07e4a0..db49a8852bdab54f6050b4d7abae9432769eee87 100755 --- a/tests/PHPUnit/Integration/ApiGetReportMetadataTest.php +++ b/tests/PHPUnit/Integration/ApiGetReportMetadataTest.php @@ -5,14 +5,21 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\API\Proxy; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\ThreeGoalsOnePageview; /** * This tests the output of the API plugin API * It will return metadata about all API reports from all plugins * as well as the data itself, pre-processed and ready to be displayed + * + * @group Integration + * @group ApiGetReportMetadataTest */ -class Test_Piwik_Integration_ApiGetReportMetadata extends IntegrationTestCase +class ApiGetReportMetadataTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition @@ -75,7 +82,6 @@ class Test_Piwik_Integration_ApiGetReportMetadata extends IntegrationTestCase /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -83,5 +89,4 @@ class Test_Piwik_Integration_ApiGetReportMetadata extends IntegrationTestCase } } -Test_Piwik_Integration_ApiGetReportMetadata::$fixture = new Test_Piwik_Fixture_ThreeGoalsOnePageview(); - +ApiGetReportMetadataTest::$fixture = new ThreeGoalsOnePageview(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/ApiGetReportMetadata_yearTest.php b/tests/PHPUnit/Integration/ApiGetReportMetadataYearTest.php similarity index 74% rename from tests/PHPUnit/Integration/ApiGetReportMetadata_yearTest.php rename to tests/PHPUnit/Integration/ApiGetReportMetadataYearTest.php index 01a19ed2ded10947059008e527c5d9f0a7f908f4..44da8df4496e80a8730d0cbc315b131e84e3dcfd 100755 --- a/tests/PHPUnit/Integration/ApiGetReportMetadata_yearTest.php +++ b/tests/PHPUnit/Integration/ApiGetReportMetadataYearTest.php @@ -5,12 +5,19 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\InvalidVisits; /** * test the Yearly metadata API response, * with no visits, with custom response language + * + * @group Integration + * @group ApiGetReportMetadataYearTest */ -class Test_Piwik_Integration_ApiGetReportMetadata_Year extends IntegrationTestCase +class ApiGetReportMetadataYearTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition @@ -34,7 +41,6 @@ class Test_Piwik_Integration_ApiGetReportMetadata_Year extends IntegrationTestCa /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -42,6 +48,5 @@ class Test_Piwik_Integration_ApiGetReportMetadata_Year extends IntegrationTestCa } } -Test_Piwik_Integration_ApiGetReportMetadata_Year::$fixture = new Test_Piwik_Fixture_InvalidVisits(); -Test_Piwik_Integration_ApiGetReportMetadata_Year::$fixture->trackInvalidRequests = false; - +ApiGetReportMetadataYearTest::$fixture = new InvalidVisits(); +ApiGetReportMetadataYearTest::$fixture->trackInvalidRequests = false; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/ArchiveCronTest.php b/tests/PHPUnit/Integration/ArchiveCronTest.php index 25c8ff418af3a8857ff36ae3ccee5085a0fc32bc..eceb90a482db0bc8ee01061fa9d4bcc87942a88b 100644 --- a/tests/PHPUnit/Integration/ArchiveCronTest.php +++ b/tests/PHPUnit/Integration/ArchiveCronTest.php @@ -5,9 +5,14 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; use Piwik\Date; use Piwik\Plugins\SitesManager\API; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\ManySitesImportedLogs; +use Piwik\Tests\Fixture; +use Exception; /** * Tests to call the cron core:archive command script and check there is no error, @@ -15,9 +20,10 @@ use Piwik\Plugins\SitesManager\API; * This tests that, when archiving is disabled, * then Piwik API will return data that was pre-processed during archive.php run * + * @group Integration * @group ArchiveCronTest */ -class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase +class ArchiveCronTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition @@ -52,8 +58,8 @@ class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase 'segment' => 'browserCode==EP', 'testSuffix' => '_nonPreArchivedSegment')); - $segments = array(Test_Piwik_Fixture_ManySitesImportedLogs::SEGMENT_PRE_ARCHIVED, - Test_Piwik_Fixture_ManySitesImportedLogs::SEGMENT_PRE_ARCHIVED_CONTAINS_ENCODED + $segments = array(ManySitesImportedLogs::SEGMENT_PRE_ARCHIVED, + ManySitesImportedLogs::SEGMENT_PRE_ARCHIVED_CONTAINS_ENCODED ); foreach($segments as $segment) { // TODO debugging travis @@ -72,9 +78,6 @@ class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase return $results; } - /** - * @group Integration - */ public function testArchivePhpCron() { if(self::isPhpVersion53()) { @@ -163,5 +166,5 @@ class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase } } -Test_Piwik_Integration_ArchiveCronTest::$fixture = new Test_Piwik_Fixture_ManySitesImportedLogs(); -Test_Piwik_Integration_ArchiveCronTest::$fixture->addSegments = true; \ No newline at end of file +ArchiveCronTest::$fixture = new ManySitesImportedLogs(); +ArchiveCronTest::$fixture->addSegments = true; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/ArchiveWebTest.php b/tests/PHPUnit/Integration/ArchiveWebTest.php index 570b3b6290170bd570b9c8eae9cb8e8f4bc0ed40..4beb5643048ee21003f6fba180ce563dda4208cb 100644 --- a/tests/PHPUnit/Integration/ArchiveWebTest.php +++ b/tests/PHPUnit/Integration/ArchiveWebTest.php @@ -5,16 +5,22 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; use Piwik\Option; use Piwik\Http; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\ManySitesImportedLogs; +use Piwik\Tests\Fixture; +use Exception; /** - * Tests to call the archive.php script via web and check there is no error, + * Tests to call the archive.php script via web and check there is no error. + * * @group Integration * @group ArchiveWebTest */ -class Test_Piwik_Integration_ArchiveWebTest extends IntegrationTestCase +class ArchiveWebTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition @@ -71,5 +77,5 @@ class Test_Piwik_Integration_ArchiveWebTest extends IntegrationTestCase } } -Test_Piwik_Integration_ArchiveWebTest::$fixture = new Test_Piwik_Fixture_ManySitesImportedLogs(); -Test_Piwik_Integration_ArchiveWebTest::$fixture->addSegments = true; \ No newline at end of file +ArchiveWebTest::$fixture = new ManySitesImportedLogs(); +ArchiveWebTest::$fixture->addSegments = true; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/AutoSuggestAPITest.php b/tests/PHPUnit/Integration/AutoSuggestAPITest.php index a9e5c404d2597d0ea650a8bcb947ee3ab41f026a..f893d258c67868b735805bf33eb52ae662994586 100644 --- a/tests/PHPUnit/Integration/AutoSuggestAPITest.php +++ b/tests/PHPUnit/Integration/AutoSuggestAPITest.php @@ -5,13 +5,21 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\API\Request; use Piwik\Date; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\ManyVisitsWithGeoIP; +use Piwik\Tests\Fixture; /** * testing a the auto suggest API for all known segments + * + * @group AutoSuggestAPITest + * @group Integration */ -class Test_Piwik_Integration_AutoSuggestAPITest extends IntegrationTestCase +class AutoSuggestAPITest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition @@ -20,7 +28,6 @@ class Test_Piwik_Integration_AutoSuggestAPITest extends IntegrationTestCase /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -76,7 +83,6 @@ class Test_Piwik_Integration_AutoSuggestAPITest extends IntegrationTestCase /** * @depends testApi * @dataProvider getAnotherApiForTesting - * @group Integration */ public function testAnotherApi($api, $params) { @@ -124,7 +130,6 @@ class Test_Piwik_Integration_AutoSuggestAPITest extends IntegrationTestCase } /** - * @group Integration * @depends testAnotherApi */ public function testCheckOtherTestsWereComplete() @@ -140,5 +145,5 @@ class Test_Piwik_Integration_AutoSuggestAPITest extends IntegrationTestCase } } -Test_Piwik_Integration_AutoSuggestAPITest::$fixture = new Test_Piwik_Fixture_ManyVisitsWithGeoIP(); -Test_Piwik_Integration_AutoSuggestAPITest::$fixture->dateTime = Date::yesterday()->subDay(30)->getDatetime(); +AutoSuggestAPITest::$fixture = new ManyVisitsWithGeoIP(); +AutoSuggestAPITest::$fixture->dateTime = Date::yesterday()->subDay(30)->getDatetime(); diff --git a/tests/PHPUnit/Integration/BackwardsCompatibility1XTest.php b/tests/PHPUnit/Integration/BackwardsCompatibility1XTest.php index da23211edf5812d300865eb4fab5dcb7674e6606..1331786c69f12ac2ba09df2bd3c7e5f6f1feb4dc 100644 --- a/tests/PHPUnit/Integration/BackwardsCompatibility1XTest.php +++ b/tests/PHPUnit/Integration/BackwardsCompatibility1XTest.php @@ -5,19 +5,22 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; use Piwik\Common; use Piwik\Db; -use Piwik\Plugins\CoreUpdater\CoreUpdater; use Piwik\Plugins\VisitFrequency\API as VisitFrequencyApi; -use Piwik\Updater; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\SqlDump; +use Piwik\Tests\Fixture; /** * Tests that Piwik 2.0 works w/ data from Piwik 1.12. * * @group BackwardsCompatibility1XTest + * @group Integration */ -class Test_Piwik_Integration_BackwardsCompatibility1XTest extends IntegrationTestCase +class BackwardsCompatibility1XTest extends IntegrationTestCase { const FIXTURE_LOCATION = '/tests/resources/piwik-1.13-dump.sql'; @@ -27,7 +30,10 @@ class Test_Piwik_Integration_BackwardsCompatibility1XTest extends IntegrationTes { parent::setUpBeforeClass(); - self::updateDatabase(); + $result = Fixture::updateDatabase(); + if ($result === false) { + throw new \Exception("Failed to update pre-2.0 database (nothing to update)."); + } // truncate log tables so old data won't be re-archived foreach (array('log_visit', 'log_link_visit_action', 'log_conversion', 'log_conversion_item') as $table) { @@ -49,23 +55,6 @@ class Test_Piwik_Integration_BackwardsCompatibility1XTest extends IntegrationTes VisitFrequencyApi::getInstance()->get(1, 'year', '2012-12-29'); } - private static function updateDatabase() - { - $updater = new Updater(); - $componentsWithUpdateFile = CoreUpdater::getComponentUpdates($updater); - if (empty($componentsWithUpdateFile)) { - throw new \Exception("Failed to update pre-2.0 database (nothing to update)."); - } - - $result = CoreUpdater::updateComponents($updater, $componentsWithUpdateFile); - if (!empty($result['coreError']) - && !empty($result['warnings']) - && !empty($result['errors']) - ) { - throw new \Exception("Failed to update pre-2.0 database (errors or warnings found): " . print_r($result, true)); - } - } - public function setUp() { parent::setUp(); @@ -81,7 +70,6 @@ class Test_Piwik_Integration_BackwardsCompatibility1XTest extends IntegrationTes /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -118,7 +106,6 @@ class Test_Piwik_Integration_BackwardsCompatibility1XTest extends IntegrationTes } } -Test_Piwik_Integration_BackwardsCompatibility1XTest::$fixture = new Piwik_Test_Fixture_SqlDump(); -Test_Piwik_Integration_BackwardsCompatibility1XTest::$fixture->dumpUrl = - PIWIK_INCLUDE_PATH . Test_Piwik_Integration_BackwardsCompatibility1XTest::FIXTURE_LOCATION; -Test_Piwik_Integration_BackwardsCompatibility1XTest::$fixture->tablesPrefix = ''; \ No newline at end of file +BackwardsCompatibility1XTest::$fixture = new SqlDump(); +BackwardsCompatibility1XTest::$fixture->dumpUrl = PIWIK_INCLUDE_PATH . BackwardsCompatibility1XTest::FIXTURE_LOCATION; +BackwardsCompatibility1XTest::$fixture->tablesPrefix = ''; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/BlobReportLimitingTest.php b/tests/PHPUnit/Integration/BlobReportLimitingTest.php index db5db0f154c790ac7d2d4be65e32e97a5d805d97..8010501886c00d04dcb0882bf6b1b0acf1a1231d 100755 --- a/tests/PHPUnit/Integration/BlobReportLimitingTest.php +++ b/tests/PHPUnit/Integration/BlobReportLimitingTest.php @@ -5,17 +5,23 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; use Piwik\Config; use Piwik\Plugins\Actions\ArchivingHelper; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\ManyVisitsWithMockLocationProvider; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php'; /** * Test Piwik's report limiting code. Make sure the datatable_archiving_maximum_rows_... * config options limit the size of certain reports when archiving. + * + * @group Integration + * @group BlobReportLimitingTest */ -class Test_Piwik_Integration_BlobReportLimitingTest extends IntegrationTestCase +class BlobReportLimitingTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition @@ -85,16 +91,12 @@ class Test_Piwik_Integration_BlobReportLimitingTest extends IntegrationTestCase /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { $this->runApiTests($api, $params); } - /** - * @group Integration - */ public function testApiWithRankingQuery() { // custom setup @@ -114,9 +116,6 @@ class Test_Piwik_Integration_BlobReportLimitingTest extends IntegrationTestCase } } - /** - * @group Integration - */ public function testApiWithRankingQueryDisabled() { self::deleteArchiveTables(); @@ -163,5 +162,5 @@ class Test_Piwik_Integration_BlobReportLimitingTest extends IntegrationTestCase } } -Test_Piwik_Integration_BlobReportLimitingTest::$fixture = new Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider(); -Test_Piwik_Integration_BlobReportLimitingTest::$fixture->createConfig = false; \ No newline at end of file +BlobReportLimitingTest::$fixture = new ManyVisitsWithMockLocationProvider(); +BlobReportLimitingTest::$fixture->createConfig = false; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php b/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php index e970ec97699ec10335e3eb1c718e18e8ee42585a..a87ee6dd8fc36236aca24d2ca285f22db553fdd1 100644 --- a/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php +++ b/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php @@ -335,7 +335,7 @@ class Core_ArchiveProcessingTest extends DatabaseTestCase . ' The error Messages from MySQL were: ' . $didWeUseBulk . "\n\n Learn more how to enable LOAD LOCAL DATA INFILE see the Mysql doc (http://dev.mysql.com/doc/refman/5.0/en/load-data-local.html) " - . "\n or ask in this Piwik ticket (http://dev.piwik.org/trac/ticket/3605)" + . "\n or ask in this Piwik ticket (https://github.com/piwik/piwik/issues/3605)" ); } return $didWeUseBulk; diff --git a/tests/PHPUnit/Integration/Core/CliMultiTest.php b/tests/PHPUnit/Integration/Core/CliMultiTest.php index da462def036dbd7f3201aaa61b71b5d30d6a1540..fc337957f2c641c5de3c652fe27109d5b510cabe 100644 --- a/tests/PHPUnit/Integration/Core/CliMultiTest.php +++ b/tests/PHPUnit/Integration/Core/CliMultiTest.php @@ -8,6 +8,8 @@ use Piwik\CliMulti; use Piwik\Version; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixture; /** * Class Core_CliMultiTest diff --git a/tests/PHPUnit/Integration/Core/JsProxyTest.php b/tests/PHPUnit/Integration/Core/JsProxyTest.php index 9e808f943b9febc75d6f9cabf9a0152e4b49b5cf..91fe30dfaeab56da2b0e9d3cf85ccd596f3f6de3 100644 --- a/tests/PHPUnit/Integration/Core/JsProxyTest.php +++ b/tests/PHPUnit/Integration/Core/JsProxyTest.php @@ -1,5 +1,14 @@ <?php -class Test_Piwik_JsProxy extends IntegrationTestCase +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +use Piwik\Tests\Fixture; + +class Test_Piwik_JsProxy extends PHPUnit_Framework_TestCase { /** * @group Core diff --git a/tests/PHPUnit/Integration/Core/SegmentTest.php b/tests/PHPUnit/Integration/Core/SegmentTest.php index 48bc2df5d186cb41f173f483eb5ec714ce7f4727..f26cd92e140ed59816f73919a0da2880160847c1 100644 --- a/tests/PHPUnit/Integration/Core/SegmentTest.php +++ b/tests/PHPUnit/Integration/Core/SegmentTest.php @@ -1,14 +1,15 @@ <?php -use Piwik\Access; -use Piwik\Common; -use Piwik\Segment; - /** * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +use Piwik\Access; +use Piwik\Common; +use Piwik\Segment; +use Piwik\Tests\Fixture; + class SegmentTest extends DatabaseTestCase { public function setUp() diff --git a/tests/PHPUnit/Integration/Core/Tracker/ActionTest.php b/tests/PHPUnit/Integration/Core/Tracker/ActionTest.php index 4a9e138b1eae0f248021295e8b8fdb85bf6e06f0..f180db3a86520ed6bb5348aa24be07e5f99050d2 100644 --- a/tests/PHPUnit/Integration/Core/Tracker/ActionTest.php +++ b/tests/PHPUnit/Integration/Core/Tracker/ActionTest.php @@ -1,4 +1,10 @@ <?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ use Piwik\Access; use Piwik\Config; use Piwik\Plugins\SitesManager\API; diff --git a/tests/PHPUnit/Integration/Core/TrackerTest.php b/tests/PHPUnit/Integration/Core/TrackerTest.php index 24dbab777c2f08dc994b5e7899c02009c1eee41a..51c8b2aafcdf86807c0f0ae988c3dcba1ea8e2d0 100644 --- a/tests/PHPUnit/Integration/Core/TrackerTest.php +++ b/tests/PHPUnit/Integration/Core/TrackerTest.php @@ -6,6 +6,8 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +use Piwik\Tests\Fixture; + /** * @group Core */ diff --git a/tests/PHPUnit/Integration/Core/UpdaterTest.php b/tests/PHPUnit/Integration/Core/UpdaterTest.php index 292e9217a5b6b626abfcc7d0be4e82bf71970ee9..6745a3fe1d02081d55246f4764e121888df11737 100644 --- a/tests/PHPUnit/Integration/Core/UpdaterTest.php +++ b/tests/PHPUnit/Integration/Core/UpdaterTest.php @@ -5,18 +5,20 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration\Core; + +use DatabaseTestCase; use Piwik\Updater; +use Piwik\Tests\Fixture; /** * Class Core_UpdaterTest * * @group Core + * @group Core_UpdaterTest */ -class Core_UpdaterTest extends DatabaseTestCase +class UpdaterTest extends DatabaseTestCase { - /** - * @group Core - */ public function testUpdaterChecksCoreVersionAndDetectsUpdateFile() { $updater = new Updater(); @@ -27,9 +29,6 @@ class Core_UpdaterTest extends DatabaseTestCase $this->assertEquals(1, count($componentsWithUpdateFile)); } - /** - * @group Core - */ public function testUpdaterChecksGivenPluginVersionAndDetectsMultipleUpdateFileInOrder() { $updater = new Updater(); @@ -50,9 +49,6 @@ class Core_UpdaterTest extends DatabaseTestCase $this->assertEquals($expectedInOrder, array_map("basename", $updateFiles)); } - /** - * @group Core - */ public function testUpdaterChecksCoreAndPluginCheckThatCoreIsRanFirst() { $updater = new Updater(); @@ -70,4 +66,12 @@ class Core_UpdaterTest extends DatabaseTestCase reset($componentsWithUpdateFile); $this->assertEquals('core', key($componentsWithUpdateFile)); } -} + + public function testUpdateWorksAfterPiwikIsAlreadyUpToDate() + { + $result = Fixture::updateDatabase($force = true); + if ($result === false) { + throw new \Exception("Failed to force update (nothing to update)."); + } + } +} \ No newline at end of file diff --git a/tests/PHPUnit/Integration/Core/WidgetsListTest.php b/tests/PHPUnit/Integration/Core/WidgetsListTest.php index 4e11718d5ac5514bec4621eb8b7d2a58f4b22174..ab3dcb9f8885c1afb6ac41675dbc88a002e139e6 100644 --- a/tests/PHPUnit/Integration/Core/WidgetsListTest.php +++ b/tests/PHPUnit/Integration/Core/WidgetsListTest.php @@ -9,6 +9,7 @@ use Piwik\Access; use Piwik\Plugins\Goals\API; use Piwik\WidgetsList; +use Piwik\Tests\Fixture; /** * Class Core_WidgetsListTest diff --git a/tests/PHPUnit/Integration/CsvExportTest.php b/tests/PHPUnit/Integration/CsvExportTest.php index 3acf831a84e7801c3444636f9d62f20ccf3a48e7..371875fa0b85bd7cd981f08f9cbb4d83d909cae1 100755 --- a/tests/PHPUnit/Integration/CsvExportTest.php +++ b/tests/PHPUnit/Integration/CsvExportTest.php @@ -5,11 +5,18 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables; /** * Test CSV export with Expanded rows, Translated labels, Different languages + * + * @group CsvExportTest + * @group Integration */ -class Test_Piwik_Integration_CsvExport extends IntegrationTestCase +class CsvExportTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition @@ -59,7 +66,6 @@ class Test_Piwik_Integration_CsvExport extends IntegrationTestCase /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -72,8 +78,7 @@ class Test_Piwik_Integration_CsvExport extends IntegrationTestCase } } -Test_Piwik_Integration_CsvExport::$fixture = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables(); -Test_Piwik_Integration_CsvExport::$fixture->visitorId = null; -Test_Piwik_Integration_CsvExport::$fixture->useEscapedQuotes = false; -Test_Piwik_Integration_CsvExport::$fixture->doExtraQuoteTests = false; - +CsvExportTest::$fixture = new TwoVisitsWithCustomVariables(); +CsvExportTest::$fixture->visitorId = null; +CsvExportTest::$fixture->useEscapedQuotes = false; +CsvExportTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/CustomEventsTest.php b/tests/PHPUnit/Integration/CustomEventsTest.php index 11ef1524550e691f7f731f3311eb3fa1f8965d0a..c2a3bd9c6267f1532c3057bb9d6254b29505ee24 100644 --- a/tests/PHPUnit/Integration/CustomEventsTest.php +++ b/tests/PHPUnit/Integration/CustomEventsTest.php @@ -5,17 +5,23 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoVisitsWithCustomEvents; /** * Testing Custom Events + * + * @group CustomEventsTest + * @group Integration */ -class Test_Piwik_Integration_CustomEvents extends IntegrationTestCase +class CustomEventsTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -132,6 +138,4 @@ class Test_Piwik_Integration_CustomEvents extends IntegrationTestCase } } -Test_Piwik_Integration_CustomEvents::$fixture = new Test_Piwik_Fixture_TwoVisitsWithCustomEvents(); - - +CustomEventsTest::$fixture = new TwoVisitsWithCustomEvents(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php b/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php index 89d4cd8e9ed4c5926f850e943c270dd67fb66216..e4f5fc154b0bdb2eb58bcdfdfbefb9d16371ef35 100755 --- a/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php +++ b/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php @@ -5,20 +5,23 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\Date; use Piwik\Piwik; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoSitesEcommerceOrderWithItems; /** * Tests API methods after ecommerce orders are tracked. + * + * @group EcommerceOrderWithItemsTest + * @group Integration */ -class Test_Piwik_Integration_EcommerceOrderWithItems extends IntegrationTestCase +class EcommerceOrderWithItemsTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition - /** - * @group Integration - * * - */ public function testImagesIncludedInTests() { $this->alertWhenImagesExcludedFromTests(); @@ -26,8 +29,6 @@ class Test_Piwik_Integration_EcommerceOrderWithItems extends IntegrationTestCase /** * @dataProvider getApiForTesting - * @group Integration - * * */ public function testApi($api, $params) { @@ -254,5 +255,4 @@ class Test_Piwik_Integration_EcommerceOrderWithItems extends IntegrationTestCase } } -Test_Piwik_Integration_EcommerceOrderWithItems::$fixture = new Test_Piwik_Fixture_TwoSitesEcommerceOrderWithItems(); - +EcommerceOrderWithItemsTest::$fixture = new TwoSitesEcommerceOrderWithItems(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/FlattenReportsTest.php b/tests/PHPUnit/Integration/FlattenReportsTest.php index e7407f87f0cc3327b90c2c6015769a7dea110802..389f3c0e7b0a0b6ce55656b80e15e745c30eee0c 100644 --- a/tests/PHPUnit/Integration/FlattenReportsTest.php +++ b/tests/PHPUnit/Integration/FlattenReportsTest.php @@ -5,18 +5,23 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\ManyVisitsWithSubDirReferrersAndCustomVars; /** * Tests the flattening of reports. + * + * @group FlattenReportsTest + * @group Integration */ -class Test_Piwik_Integration_FlattenReports extends IntegrationTestCase +class FlattenReportsTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration - * */ public function testApi($api, $params) { @@ -120,6 +125,4 @@ class Test_Piwik_Integration_FlattenReports extends IntegrationTestCase } } -Test_Piwik_Integration_FlattenReports::$fixture = - new Test_Piwik_Fixture_ManyVisitsWithSubDirReferrersAndCustomVars(); - +FlattenReportsTest::$fixture = new ManyVisitsWithSubDirReferrersAndCustomVars(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/ImportLogsTest.php b/tests/PHPUnit/Integration/ImportLogsTest.php index 489fdc95e2e22784a80103c21a31c1092ce9b783..83b1da785a3fd9c3dcc1bc397aac6250bff1053f 100755 --- a/tests/PHPUnit/Integration/ImportLogsTest.php +++ b/tests/PHPUnit/Integration/ImportLogsTest.php @@ -5,19 +5,25 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\Access; use Piwik\Plugins\SitesManager\API; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\ManySitesImportedLogs; /** * Tests the log importer. + * + * @group ImportLogsTest + * @group Integration */ -class Test_Piwik_Integration_ImportLogs extends IntegrationTestCase +class ImportLogsTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -69,9 +75,6 @@ class Test_Piwik_Integration_ImportLogs extends IntegrationTestCase } /** - * @group Integration - * - * * NOTE: This test must be last since the new sites that get added are added in * random order. */ @@ -99,5 +102,4 @@ class Test_Piwik_Integration_ImportLogs extends IntegrationTestCase } } -Test_Piwik_Integration_ImportLogs::$fixture = new Test_Piwik_Fixture_ManySitesImportedLogs(); - +ImportLogsTest::$fixture = new ManySitesImportedLogs(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/LabelFilterTest.php b/tests/PHPUnit/Integration/LabelFilterTest.php index b8695f274bf5f6ced0b9ac2dd382e18657ccce1c..5435809fff2d7f3629d5f2b9e39db3dfbb7ed652 100644 --- a/tests/PHPUnit/Integration/LabelFilterTest.php +++ b/tests/PHPUnit/Integration/LabelFilterTest.php @@ -5,20 +5,24 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\OneVisitSeveralPageViews; /** * Tests the class LabelFilter. * This is not possible as unit test, since it loads data from the archive. * * @group LabelFilterTest + * @group Integration */ -class Test_Piwik_Integration_LabelFilter extends IntegrationTestCase +class LabelFilterTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -112,6 +116,50 @@ class Test_Piwik_Integration_LabelFilter extends IntegrationTestCase $searchEngineTest['otherRequestParameters']['label'] = urlencode('Google>' . urlencode(html_entity_decode($keyword))); $return[] = array('Referrers.getSearchEngines', $searchEngineTest); + // test the ! operator + $return[] = array('Actions.getPageTitles', array( + 'testSuffix' => '_terminalOperator_selectTerminal', + 'idSite' => $idSite, + 'date' => $dateTime, + 'otherRequestParameters' => array( + 'label' => urlencode(urlencode('check <>') . '> @ ' . urlencode('@one@')), + 'expanded' => 0 + ) + )); + + $return[] = array('Actions.getPageTitles', array( + 'testSuffix' => '_terminalOperator_selectBranch', + 'idSite' => $idSite, + 'date' => $dateTime, + 'otherRequestParameters' => array( + 'label' => urlencode(urlencode('check <>') . '> ' . urlencode('@one@')), + 'expanded' => 0 + ) + )); + + $return[] = array('Actions.getPageUrls', array( + 'testSuffix' => '_terminalOperator_selectTerminal', + 'idSite' => $idSite, + 'date' => $dateTime, + 'otherRequestParameters' => array( + 'label' => urlencode('dir> @ /subdir'), + 'expanded' => 0 + ) + )); + + // test that filter_limit & filter_truncate are ignored when label is used + $return[] = array('Actions.getPageTitles', array( + 'testSuffix' => '_titles', + 'idSite' => $idSite, + 'date' => $dateTime, + 'otherRequestParameters' => array( + 'label' => urlencode('incredible title! <>,;'), + 'expanded' => 0, + 'filter_limit' => 1, + 'filter_truncate' => 1 + ) + )); + return $return; } @@ -121,5 +169,4 @@ class Test_Piwik_Integration_LabelFilter extends IntegrationTestCase } } -Test_Piwik_Integration_LabelFilter::$fixture = new Test_Piwik_Fixture_OneVisitSeveralPageViews(); - +LabelFilterTest::$fixture = new OneVisitSeveralPageViews(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php b/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php index 82422186e87897f7893e2802e5d9e3821de7d951..edf52ffbfdb06988eddb825bc15f4cbdc5991dbc 100755 --- a/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php +++ b/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php @@ -5,10 +5,13 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php'; use Piwik\Date; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\ManyVisitsWithGeoIP; /** * Tests w/ 14 visitors w/ 2 visits each. @@ -16,14 +19,16 @@ use Piwik\Date; * * TODO Test ServerBased GeoIP implementation somehow. (Use X-FORWARDED-FOR?) * TODO Test PECL implementation somehow. (The PECL module must point to the test dir, not the real one.) + * + * @group ManyVisitorsOneWebsiteTest + * @group Integration */ -class Test_Piwik_Integration_ManyVisitorsOneWebsiteTest extends IntegrationTestCase +class ManyVisitorsOneWebsiteTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -126,5 +131,4 @@ class Test_Piwik_Integration_ManyVisitorsOneWebsiteTest extends IntegrationTestC } } -Test_Piwik_Integration_ManyVisitorsOneWebsiteTest::$fixture = new Test_Piwik_Fixture_ManyVisitsWithGeoIP(); - +ManyVisitorsOneWebsiteTest::$fixture = new ManyVisitsWithGeoIP(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/NoVisitTest.php b/tests/PHPUnit/Integration/NoVisitTest.php index 6315830750460b55bfcee26eccc01466b539f567..19a09a45f943258736f46d5e7aa914a70faac338 100755 --- a/tests/PHPUnit/Integration/NoVisitTest.php +++ b/tests/PHPUnit/Integration/NoVisitTest.php @@ -5,19 +5,25 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\InvalidVisits; /** * testing various wrong Tracker requests and check that they behave as expected: * not throwing errors and not recording data. * API will archive and output empty stats. + * + * @group NoVisitTest + * @group Integration */ -class Test_Piwik_Integration_NoVisit extends IntegrationTestCase +class NoVisitTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -44,5 +50,4 @@ class Test_Piwik_Integration_NoVisit extends IntegrationTestCase } } -Test_Piwik_Integration_NoVisit::$fixture = new Test_Piwik_Fixture_InvalidVisits(); - +NoVisitTest::$fixture = new InvalidVisits(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/NonUnicodeTest.php b/tests/PHPUnit/Integration/NonUnicodeTest.php index b5b8a0c30bc5f85d54bec1a382913944c4f541d6..cb9153a0bafc918137e3b83e780201dc209467b1 100755 --- a/tests/PHPUnit/Integration/NonUnicodeTest.php +++ b/tests/PHPUnit/Integration/NonUnicodeTest.php @@ -5,18 +5,24 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\SomeVisitsWithNonUnicodePageTitles; /** * Tests that visits track & reports display correctly when non-unicode text is * used in URL query params of visits. + * + * @group NonUnicodeTest + * @group Integration */ -class Test_Piwik_Integration_NonUnicodeTest extends IntegrationTestCase +class NonUnicodeTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -46,6 +52,4 @@ class Test_Piwik_Integration_NonUnicodeTest extends IntegrationTestCase } -Test_Piwik_Integration_NonUnicodeTest::$fixture = - new Test_Piwik_Fixture_SomeVisitsWithNonUnicodePageTitles(); - +NonUnicodeTest::$fixture = new SomeVisitsWithNonUnicodePageTitles(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/OneVisitor_LongUrlsTruncatedTest.php b/tests/PHPUnit/Integration/OneVisitorLongUrlsTruncatedTest.php similarity index 79% rename from tests/PHPUnit/Integration/OneVisitor_LongUrlsTruncatedTest.php rename to tests/PHPUnit/Integration/OneVisitorLongUrlsTruncatedTest.php index ce1d5121a3966d82626e29b189baabc2ac06af48..62b94edceae7e0434c70068c6b178d040f0022f7 100644 --- a/tests/PHPUnit/Integration/OneVisitor_LongUrlsTruncatedTest.php +++ b/tests/PHPUnit/Integration/OneVisitorLongUrlsTruncatedTest.php @@ -5,16 +5,23 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\SomeVisitsWithLongUrls; + /** * Tests that filter_truncate works recursively in Page URLs report AND in the case there are 2 different data Keywords -> search engine + * + * @group OneVisitorLongUrlsTruncatedTest + * @group Integration */ -class Test_Piwik_Integration_OneVisitor_LongUrlsTruncated extends IntegrationTestCase +class OneVisitorLongUrlsTruncatedTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -44,5 +51,4 @@ class Test_Piwik_Integration_OneVisitor_LongUrlsTruncated extends IntegrationTes } } -Test_Piwik_Integration_OneVisitor_LongUrlsTruncated::$fixture = new Test_Piwik_Fixture_SomeVisitsWithLongUrls(); - +OneVisitorLongUrlsTruncatedTest::$fixture = new SomeVisitsWithLongUrls(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/OneVisitor_NoKeywordSpecifiedTest.php b/tests/PHPUnit/Integration/OneVisitorNoKeywordSpecifiedTest.php similarity index 79% rename from tests/PHPUnit/Integration/OneVisitor_NoKeywordSpecifiedTest.php rename to tests/PHPUnit/Integration/OneVisitorNoKeywordSpecifiedTest.php index 9c7c42cc2f55e30c0dfc6d2de48bb98df3258e23..c2d8ba430b7be0b55f05f22e2f02d792a48dbcbe 100755 --- a/tests/PHPUnit/Integration/OneVisitor_NoKeywordSpecifiedTest.php +++ b/tests/PHPUnit/Integration/OneVisitorNoKeywordSpecifiedTest.php @@ -5,20 +5,26 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoVisitsNoKeywordWithBot; /** * 1) Tests empty google kwd works nicely in Live! output and Top keywords * 2) Tests IP anonymization * Also test that Live! will link to the search result page URL rather than the exact referrer URL * when the referrer URL is google.XX/url.... which is a redirect to landing page rather than the search result URL + * + * @group Integration + * @group OneVisitorNoKeywordSpecifiedTest */ -class Test_Piwik_Integration_OneVisitor_NoKeywordSpecified extends IntegrationTestCase +class OneVisitorNoKeywordSpecifiedTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -47,5 +53,4 @@ class Test_Piwik_Integration_OneVisitor_NoKeywordSpecified extends IntegrationTe } } -Test_Piwik_Integration_OneVisitor_NoKeywordSpecified::$fixture = new Test_Piwik_Fixture_TwoVisitsNoKeywordWithBot(); - +OneVisitorNoKeywordSpecifiedTest::$fixture = new TwoVisitsNoKeywordWithBot(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/OneVisitorOneWebsite_SeveralDaysDateRange_ArchivingTestsTest.php b/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php similarity index 94% rename from tests/PHPUnit/Integration/OneVisitorOneWebsite_SeveralDaysDateRange_ArchivingTestsTest.php rename to tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php index 176c9e17926e66a44b2573568805b340def683c4..b7252a11d7ad9e8c3c8a3e3cd618b378dca33088 100755 --- a/tests/PHPUnit/Integration/OneVisitorOneWebsite_SeveralDaysDateRange_ArchivingTestsTest.php +++ b/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php @@ -5,15 +5,22 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\Common; use Piwik\Db; use Piwik\Piwik; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\VisitsOverSeveralDays; /** * Tests some API using range periods & makes sure the correct amount of blob/numeric * archives are created. + * + * @group OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest + * @group Integration */ -class Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange_ArchivingTests extends IntegrationTestCase +class OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest extends IntegrationTestCase { public static $fixture = null; // initialized below test definition @@ -24,8 +31,6 @@ class Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange_Archiving /** * @dataProvider getApiForTesting - * @group Integration - * * */ public function testApi($api, $params) { @@ -89,10 +94,8 @@ class Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange_Archiving /** * Check that requesting period "Range" means only processing * the requested Plugin blob (Actions in this case), not all Plugins blobs - + * * @depends testApi - * @group Integration - * * */ public function test_checkArchiveRecords_whenPeriodIsRange() { @@ -180,6 +183,4 @@ class Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange_Archiving } -Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange_ArchivingTests::$fixture - = new Test_Piwik_Fixture_VisitsOverSeveralDays(); - +OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest::$fixture = new VisitsOverSeveralDays(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/OneVisitorOneWebsite_SeveralDaysDateRangeTest.php b/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php similarity index 91% rename from tests/PHPUnit/Integration/OneVisitorOneWebsite_SeveralDaysDateRangeTest.php rename to tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php index a4731122384ed758de268543358dc20125229806..e877166a251212331cd08c2f09d103fe13c1b3d2 100755 --- a/tests/PHPUnit/Integration/OneVisitorOneWebsite_SeveralDaysDateRangeTest.php +++ b/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php @@ -5,6 +5,10 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\VisitsOverSeveralDays; /** * Use case testing various important features: @@ -12,14 +16,16 @@ * - testing period=range use case. * - Recording data before and after, checking that the requested range is processed correctly * - and more + * + * @group OneVisitorOneWebsiteSeveralDaysDateRangeTest + * @group Integration */ -class Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange extends IntegrationTestCase +class OneVisitorOneWebsiteSeveralDaysDateRangeTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -94,6 +100,4 @@ class Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange extends I } } -Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange::$fixture - = new Test_Piwik_Fixture_VisitsOverSeveralDays(); - +OneVisitorOneWebsiteSeveralDaysDateRangeTest::$fixture = new VisitsOverSeveralDays(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/OneVisitor_SeveralDays_ImportedInRandomOrderTest.php b/tests/PHPUnit/Integration/OneVisitorSeveralDaysImportedInRandomOrderTest.php similarity index 65% rename from tests/PHPUnit/Integration/OneVisitor_SeveralDays_ImportedInRandomOrderTest.php rename to tests/PHPUnit/Integration/OneVisitorSeveralDaysImportedInRandomOrderTest.php index 81af6b812327c1b07a0dc640698dc7b119aa2e11..5c4f427e7937f235d91db85a6130bf327eafe3ec 100644 --- a/tests/PHPUnit/Integration/OneVisitor_SeveralDays_ImportedInRandomOrderTest.php +++ b/tests/PHPUnit/Integration/OneVisitorSeveralDaysImportedInRandomOrderTest.php @@ -5,14 +5,26 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; -class Test_Piwik_Integration_OneVisitor_SeveralDays_ImportedInRandomOrderTest extends IntegrationTestCase +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\VisitOverSeveralDaysImportedLogs; + +/** + * @group Integration + * @group OneVisitorSeveralDaysImportedInRandomOrderTest + */ +class OneVisitorSeveralDaysImportedInRandomOrderTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition + public static function getOutputPrefix() + { + return "OneVisitor_SeveralDays_ImportedInRandomOrderTest"; + } + /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -33,10 +45,6 @@ class Test_Piwik_Integration_OneVisitor_SeveralDays_ImportedInRandomOrderTest ex )), ); } - - - } -Test_Piwik_Integration_OneVisitor_SeveralDays_ImportedInRandomOrderTest::$fixture = new Test_Piwik_Fixture_VisitOverSeveralDaysImportedLogs(); - +OneVisitorSeveralDaysImportedInRandomOrderTest::$fixture = new VisitOverSeveralDaysImportedLogs(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php b/tests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php index 5526d6fc71ae7ff8c067046009e3c81d52ec55dd..94f8f79153aa9539d59d6cd5307952082c1b6900 100755 --- a/tests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php +++ b/tests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php @@ -5,8 +5,13 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\API\Proxy; use Piwik\Archive; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\OneVisitorTwoVisits; +use Exception; /** * This use case covers many simple tracking features. @@ -17,8 +22,11 @@ use Piwik\Archive; * - In a returning visit, tracks a Goal conversion * URL matching, with custom referrer and keyword * NO cookie support + * + * @group Integration + * @group OneVisitorTwoVisitsTest */ -class Test_Piwik_Integration_OneVisitorTwoVisits extends IntegrationTestCase +class OneVisitorTwoVisitsTest extends IntegrationTestCase { /** * @var Test_Piwik_Fixture_OneVisitorTwoVisits @@ -35,9 +43,13 @@ class Test_Piwik_Integration_OneVisitorTwoVisits extends IntegrationTestCase Proxy::getInstance()->setHideIgnoredFunctions(true); } + public static function getOutputPrefix() + { + return "OneVisitorTwoVisits"; + } + /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -178,8 +190,6 @@ class Test_Piwik_Integration_OneVisitorTwoVisits extends IntegrationTestCase /** * Test that Archive::getBlob won't fetch extra unnecessary blobs. - * - * @group Integration */ public function testArchiveSingleGetBlob() { @@ -203,8 +213,6 @@ class Test_Piwik_Integration_OneVisitorTwoVisits extends IntegrationTestCase /** * Test that restricting the number of sites to those viewable to another login * works when building an archive query object. - * - * @group Integration */ public function testArchiveSitesWhenRestrictingToLogin() { @@ -221,5 +229,5 @@ class Test_Piwik_Integration_OneVisitorTwoVisits extends IntegrationTestCase } } -Test_Piwik_Integration_OneVisitorTwoVisits::$fixture = new Test_Piwik_Fixture_OneVisitorTwoVisits(); -Test_Piwik_Integration_OneVisitorTwoVisits::$fixture->excludeMozilla = true; \ No newline at end of file +OneVisitorTwoVisitsTest::$fixture = new OneVisitorTwoVisits(); +OneVisitorTwoVisitsTest::$fixture->excludeMozilla = true; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/OneVisitorTwoVisits_withCookieSupportTest.php b/tests/PHPUnit/Integration/OneVisitorTwoVisitsWithCookieSupportTest.php similarity index 68% rename from tests/PHPUnit/Integration/OneVisitorTwoVisits_withCookieSupportTest.php rename to tests/PHPUnit/Integration/OneVisitorTwoVisitsWithCookieSupportTest.php index c8f87c9732590a9ef65e8e3e7caf03449d2719a4..a26611801880f03e5c3936bcdfd32ad9ec869703 100755 --- a/tests/PHPUnit/Integration/OneVisitorTwoVisits_withCookieSupportTest.php +++ b/tests/PHPUnit/Integration/OneVisitorTwoVisitsWithCookieSupportTest.php @@ -5,23 +5,27 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\OneVisitorTwoVisits; /** * Same as OneVisitorTwoVisits.test.php, but with cookie support, which incurs some slight changes * in the reporting data (more accurate unique visitor count, better referrer tracking for goals, etc.) + * + * @group OneVisitorTwoVisitsWithCookieSupportTest + * @group Integration */ -class Test_Piwik_Integration_OneVisitorTwoVisits_WithCookieSupport extends IntegrationTestCase +class OneVisitorTwoVisitsWithCookieSupportTest extends IntegrationTestCase { public static $fixture = null; // initialized below class /** * @dataProvider getApiForTesting - * @group Integration - * */ public function testApi($api, $params) { - //var_dump(\Piwik\Db::get()->fetchAll('select * from piwiktests_log_action' )); $this->runApiTests($api, $params); } @@ -44,7 +48,6 @@ class Test_Piwik_Integration_OneVisitorTwoVisits_WithCookieSupport extends Integ } } -Test_Piwik_Integration_OneVisitorTwoVisits_WithCookieSupport::$fixture = new Test_Piwik_Fixture_OneVisitorTwoVisits(); -Test_Piwik_Integration_OneVisitorTwoVisits_WithCookieSupport::$fixture->useThirdPartyCookies = true; -Test_Piwik_Integration_OneVisitorTwoVisits_WithCookieSupport::$fixture->useSiteSearch = true; - +OneVisitorTwoVisitsWithCookieSupportTest::$fixture = new OneVisitorTwoVisits(); +OneVisitorTwoVisitsWithCookieSupportTest::$fixture->useThirdPartyCookies = true; +OneVisitorTwoVisitsWithCookieSupportTest::$fixture->useSiteSearch = true; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/PeriodIsRange_DateIsLastN_MetadataAndNormalAPITest.php b/tests/PHPUnit/Integration/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php similarity index 83% rename from tests/PHPUnit/Integration/PeriodIsRange_DateIsLastN_MetadataAndNormalAPITest.php rename to tests/PHPUnit/Integration/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php index b96c54f66c0cecca7e1d67d5aa090da027a18974..cbf5b2e5f7de1eac94d04b09b293a724cf7ae427 100755 --- a/tests/PHPUnit/Integration/PeriodIsRange_DateIsLastN_MetadataAndNormalAPITest.php +++ b/tests/PHPUnit/Integration/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php @@ -5,12 +5,19 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\Date; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables; /** * test Metadata API + period=range&date=lastN + * + * @group PeriodIsRangeDateIsLastNMetadataAndNormalAPITest + * @group Integration */ -class Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI extends IntegrationTestCase +class PeriodIsRangeDateIsLastNMetadataAndNormalAPITest extends IntegrationTestCase { public static $fixture = null; @@ -22,7 +29,6 @@ class Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI exte /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -80,7 +86,5 @@ class Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI exte } } -Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI::$fixture = - new Test_Piwik_Fixture_TwoVisitsWithCustomVariables(); -Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI::$fixture->doExtraQuoteTests = false; - +PeriodIsRangeDateIsLastNMetadataAndNormalAPITest::$fixture = new TwoVisitsWithCustomVariables(); +PeriodIsRangeDateIsLastNMetadataAndNormalAPITest::$fixture->doExtraQuoteTests = false; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/Plugins/UsersManagerTest.php b/tests/PHPUnit/Integration/Plugins/UsersManagerTest.php index d02e79fd5b157d642971ca90f2d3a5fa5d6c129e..cbcb6da860691a03795e28cdadc1f962e033d699 100644 --- a/tests/PHPUnit/Integration/Plugins/UsersManagerTest.php +++ b/tests/PHPUnit/Integration/Plugins/UsersManagerTest.php @@ -1,4 +1,10 @@ <?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ use Piwik\Access; use Piwik\Plugins\SitesManager\API as APISitesManager; use Piwik\Plugins\UsersManager\API; diff --git a/tests/PHPUnit/Integration/PrivacyManagerTest.php b/tests/PHPUnit/Integration/PrivacyManagerTest.php index c8a6d975b028baf8d643452e59a754c738f78e3f..591be30265772addcd1f53d6f1ecf5cd7f7b77c3 100644 --- a/tests/PHPUnit/Integration/PrivacyManagerTest.php +++ b/tests/PHPUnit/Integration/PrivacyManagerTest.php @@ -5,6 +5,8 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\Archive; use Piwik\ArchiveProcessor\Rules; use Piwik\Common; @@ -23,9 +25,15 @@ use Piwik\Plugins\VisitorInterest\API as APIVisitorInterest; use Piwik\Site; use Piwik\Tracker\Cache; use Piwik\Tracker\GoalManager; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixture; require_once 'PrivacyManager/PrivacyManager.php'; +/** + * @group PrivacyManagerTest + * @group Integration + */ class PrivacyManagerTest extends IntegrationTestCase { // constants used in checking whether numeric tables are populated correctly. @@ -134,8 +142,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Make sure the first time deleteLogData is run, nothing happens. - * - * @group Integration */ public function testDeleteLogDataInitialRun() { @@ -153,8 +159,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Make sure the first time deleteReportData is run, nothing happens. - * - * @group Integration */ public function testDeleteReportDataInitialRun() { @@ -169,8 +173,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Make sure the task is not run when its scheduled for later. - * - * @group Integration */ public function testPurgeDataNotTimeToRun() { @@ -188,8 +190,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Make sure purging data runs when scheduled. - * - * @group Integration */ public function testPurgeDataNotInitialAndTimeToRun() { @@ -234,8 +234,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Make sure nothing happens when deleting logs & reports are both disabled. - * - * @group Integration */ public function testPurgeDataBothDisabled() { @@ -263,8 +261,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Test that purgeData works when there's no data. - * - * @group Integration */ public function testPurgeDataDeleteLogsNoData() { @@ -301,8 +297,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Test that purgeData works correctly when the 'keep basic metrics' setting is set to true. - * - * @group Integration */ public function testPurgeDataDeleteReportsKeepBasicMetrics() { @@ -357,8 +351,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Test that purgeData works correctly when the 'keep daily reports' setting is set to true. - * - * @group Integration */ public function testPurgeDataDeleteReportsKeepDailyReports() { @@ -393,8 +385,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Test that purgeData works correctly when the 'keep weekly reports' setting is set to true. - * - * @group Integration */ public function testPurgeDataDeleteReportsKeepWeeklyReports() { @@ -429,8 +419,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Test that purgeData works correctly when the 'keep monthly reports' setting is set to true. - * - * @group Integration */ public function testPurgeDataDeleteReportsKeepMonthlyReports() { @@ -465,8 +453,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Test that purgeData works correctly when the 'keep yearly reports' setting is set to true. - * - * @group Integration */ public function testPurgeDataDeleteReportsKeepYearlyReports() { @@ -501,8 +487,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Test no concurrency issues when deleting log data from log_action table. - * - * @group Integration */ public function testPurgeLogDataConcurrency() { @@ -532,8 +516,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Tests that purgeData works correctly when the 'keep range reports' setting is set to true. - * - * @group Integration */ public function testPurgeDataDeleteReportsKeepRangeReports() { @@ -568,8 +550,6 @@ class PrivacyManagerTest extends IntegrationTestCase /** * Tests that purgeData works correctly when the 'keep segment reports' setting is set to true. - * - * @group Integration */ public function testPurgeDataDeleteReportsKeepSegmentsReports() { @@ -675,7 +655,6 @@ class PrivacyManagerTest extends IntegrationTestCase $archive = Archive::build(self::$idSite, 'year', $date); APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(self::$idSite, 'year', $date); -// APIVisitorInterest::getInstance()->get(self::$idSite, 'month', $date, $segment = false, self::$idSite); // months are added via the 'year' period, but weeks must be done manually for ($daysAgo = self::$daysAgoStart; $daysAgo > 0; $daysAgo -= 7) // every week @@ -915,5 +894,4 @@ class PrivacyManagerTest extends IntegrationTestCase ; return $eventsId; } -} - +} \ No newline at end of file diff --git a/tests/PHPUnit/Integration/PurgeDataTest.php b/tests/PHPUnit/Integration/PurgeDataTest.php index e6ea34d9c3c15c26bd540176efe8374a989ea28c..29d7ccc08407852477627de3c16e6139edc8295c 100755 --- a/tests/PHPUnit/Integration/PurgeDataTest.php +++ b/tests/PHPUnit/Integration/PurgeDataTest.php @@ -5,17 +5,23 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php'; use Piwik\API\Request; use Piwik\Plugins\PrivacyManager\PrivacyManager; use Piwik\Plugins\PrivacyManager\ReportsPurger; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\OneVisitorTwoVisits; /** + * TODO: shouldn't this be merged w/ PrivacyManagerTest? the original data purging tests are there + * * @group Integration + * @group PurgeDataTest */ -class Test_Piwik_Integration_PurgeDataTest extends IntegrationTestCase +class PurgeDataTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition @@ -185,5 +191,4 @@ class Test_Piwik_Integration_PurgeDataTest extends IntegrationTestCase } } -Test_Piwik_Integration_PurgeDataTest::$fixture = new Test_Piwik_Fixture_OneVisitorTwoVisits(); - +PurgeDataTest::$fixture = new OneVisitorTwoVisits(); diff --git a/tests/PHPUnit/Integration/RowEvolutionTest.php b/tests/PHPUnit/Integration/RowEvolutionTest.php index f0c87a06560ea407542d82904560af46e107990e..6fac424f54897b1402efb7d931b93deb3608bf02 100755 --- a/tests/PHPUnit/Integration/RowEvolutionTest.php +++ b/tests/PHPUnit/Integration/RowEvolutionTest.php @@ -5,17 +5,23 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers; /** * Tests the method API.getRowEvolution + * + * @group RowEvolutionTest + * @group Integration */ -class Test_Piwik_Integration_RowEvolution extends IntegrationTestCase +class RowEvolutionTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -230,5 +236,4 @@ class Test_Piwik_Integration_RowEvolution extends IntegrationTestCase } } -Test_Piwik_Integration_RowEvolution::$fixture - = new Test_Piwik_Fixture_TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers(); \ No newline at end of file +RowEvolutionTest::$fixture = new TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/SiteSearchTest.php b/tests/PHPUnit/Integration/SiteSearchTest.php index f329833f9ca512995f25dc814a6722edd299d5df..0ae3c73fd207ec26afb1c3de387966763e6ef7ba 100755 --- a/tests/PHPUnit/Integration/SiteSearchTest.php +++ b/tests/PHPUnit/Integration/SiteSearchTest.php @@ -5,17 +5,23 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\ThreeSitesWithManyVisitsWithSiteSearch; /** * Testing the various use cases w/ internal Site Search tracking + * + * @group SiteSearchTest + * @group Integration */ -class Test_Piwik_Integration_SiteSearch extends IntegrationTestCase +class SiteSearchTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -86,5 +92,4 @@ class Test_Piwik_Integration_SiteSearch extends IntegrationTestCase } } -Test_Piwik_Integration_SiteSearch::$fixture = new Test_Piwik_Fixture_ThreeSitesWithManyVisitsWithSiteSearch(); - +SiteSearchTest::$fixture = new ThreeSitesWithManyVisitsWithSiteSearch(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TimezonesTest.php b/tests/PHPUnit/Integration/TimezonesTest.php index 26d77d6dacfc1b243fa6c5395d07d02ec113364c..1603c23cb468d8e948036f82a73b848fe918623d 100644 --- a/tests/PHPUnit/Integration/TimezonesTest.php +++ b/tests/PHPUnit/Integration/TimezonesTest.php @@ -5,12 +5,19 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\Date; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\VisitsInDifferentTimezones; /** * Test reports using visits for a site with a non-UTC timezone. + * + * @group TimezonesTest + * @group Integration */ -class Test_Piwik_Integration_TimezonesTest extends IntegrationTestCase +class TimezonesTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition @@ -41,7 +48,6 @@ class Test_Piwik_Integration_TimezonesTest extends IntegrationTestCase /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -49,4 +55,4 @@ class Test_Piwik_Integration_TimezonesTest extends IntegrationTestCase } } -Test_Piwik_Integration_TimezonesTest::$fixture = new Test_Piwik_Fixture_VisitsInDifferentTimezones(); \ No newline at end of file +TimezonesTest::$fixture = new VisitsInDifferentTimezones(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TrackCustomVariablesAndCampaigns_ForceUsingVisitIdNotHeuristicsTest.php b/tests/PHPUnit/Integration/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php similarity index 67% rename from tests/PHPUnit/Integration/TrackCustomVariablesAndCampaigns_ForceUsingVisitIdNotHeuristicsTest.php rename to tests/PHPUnit/Integration/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php index 3ccefa4a64d097a4935f4a2b539a61fa6aff9bcc..3f45410510270144bb3f1e9153cacefd3fc1f4f5 100755 --- a/tests/PHPUnit/Integration/TrackCustomVariablesAndCampaigns_ForceUsingVisitIdNotHeuristicsTest.php +++ b/tests/PHPUnit/Integration/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php @@ -5,18 +5,24 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\SomeVisitsCustomVariablesCampaignsNotHeuristics; /** * Test tracker & API when forcing the use of visit ID instead of heuristics. Also * tests campaign tracking. + * + * @group TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest + * @group Integration */ -class Test_Piwik_Integration_TrackCustomVariablesAndCampaigns_ForceUsingVisitIdNotHeuristics extends IntegrationTestCase +class TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -39,6 +45,5 @@ class Test_Piwik_Integration_TrackCustomVariablesAndCampaigns_ForceUsingVisitIdN } } -Test_Piwik_Integration_TrackCustomVariablesAndCampaigns_ForceUsingVisitIdNotHeuristics::$fixture = - new Test_Piwik_Fixture_SomeVisitsCustomVariablesCampaignsNotHeuristics(); - +TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest::$fixture = + new SomeVisitsCustomVariablesCampaignsNotHeuristics(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TrackGoals_AllowMultipleConversionsPerVisitTest.php b/tests/PHPUnit/Integration/TrackGoalsAllowMultipleConversionsPerVisitTest.php similarity index 79% rename from tests/PHPUnit/Integration/TrackGoals_AllowMultipleConversionsPerVisitTest.php rename to tests/PHPUnit/Integration/TrackGoalsAllowMultipleConversionsPerVisitTest.php index a1eb784ff6b904661bdcba3617c7fd6575d3fbad..6ed0f41a4655bdd91fa735b6766bfd0230f58f1b 100755 --- a/tests/PHPUnit/Integration/TrackGoals_AllowMultipleConversionsPerVisitTest.php +++ b/tests/PHPUnit/Integration/TrackGoalsAllowMultipleConversionsPerVisitTest.php @@ -5,19 +5,25 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\Plugins\Goals\API; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\SomeVisitsAllConversions; /** * Tests API methods with goals that do and don't allow multiple * conversions per visit. + * + * @group TrackGoalsAllowMultipleConversionsPerVisitTest + * @group Integration */ -class Test_Piwik_Integration_TrackGoals_AllowMultipleConversionsPerVisit extends IntegrationTestCase +class TrackGoalsAllowMultipleConversionsPerVisitTest extends IntegrationTestCase { public static $fixture = null; /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -26,7 +32,6 @@ class Test_Piwik_Integration_TrackGoals_AllowMultipleConversionsPerVisit extends /** * @depends testApi - * @group Integration */ public function testCheck() { @@ -59,5 +64,4 @@ class Test_Piwik_Integration_TrackGoals_AllowMultipleConversionsPerVisit extends } } -Test_Piwik_Integration_TrackGoals_AllowMultipleConversionsPerVisit::$fixture - = new Piwik_Test_Fixture_SomeVisitsAllConversions(); +TrackGoalsAllowMultipleConversionsPerVisitTest::$fixture = new SomeVisitsAllConversions(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TrackerWindowLookBackTest.php b/tests/PHPUnit/Integration/TrackerWindowLookBackTest.php index c56d7786dd0977196a3c56b2ed0e418268fd000d..58f1eecde7d5d290187b4f343ff338652be53489 100644 --- a/tests/PHPUnit/Integration/TrackerWindowLookBackTest.php +++ b/tests/PHPUnit/Integration/TrackerWindowLookBackTest.php @@ -5,19 +5,24 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\VisitsOverSeveralDays; /** * Testing that, when using window_look_back_for_visitor with a high value, * works well with the use case of a returning visitor being assigned to today's visit * + * @group TrackerWindowLookBackTest + * @group Integration */ -class Test_Piwik_Integration_TrackerWindowLookBack extends IntegrationTestCase +class TrackerWindowLookBackTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -42,5 +47,5 @@ class Test_Piwik_Integration_TrackerWindowLookBack extends IntegrationTestCase } } -Test_Piwik_Integration_TrackerWindowLookBack::$fixture = new Test_Piwik_Fixture_VisitsOverSeveralDays(); -Test_Piwik_Integration_TrackerWindowLookBack::$fixture->forceLargeWindowLookBackForVisitor = true; +TrackerWindowLookBackTest::$fixture = new VisitsOverSeveralDays(); +TrackerWindowLookBackTest::$fixture->forceLargeWindowLookBackForVisitor = true; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TrackingAPI_SetVisitorIdTest.php b/tests/PHPUnit/Integration/TrackingAPISetVisitorIdTest.php similarity index 72% rename from tests/PHPUnit/Integration/TrackingAPI_SetVisitorIdTest.php rename to tests/PHPUnit/Integration/TrackingAPISetVisitorIdTest.php index 3c738dcf26ea537a8c611074521459269133eb9a..86885f513d860b188161bccf805803548c3ae47b 100644 --- a/tests/PHPUnit/Integration/TrackingAPI_SetVisitorIdTest.php +++ b/tests/PHPUnit/Integration/TrackingAPISetVisitorIdTest.php @@ -5,13 +5,19 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\API\Proxy; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\FewVisitsWithSetVisitorId; /** * This test tests that when using &cid=, the visitor ID is enforced * + * @group TrackingAPISetVisitorIdTest + * @group Integration */ -class Test_Piwik_Integration_TrackingAPI_SetVisitorId extends IntegrationTestCase +class TrackingAPISetVisitorIdTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition @@ -25,9 +31,13 @@ class Test_Piwik_Integration_TrackingAPI_SetVisitorId extends IntegrationTestCas Proxy::getInstance()->setHideIgnoredFunctions(true); } + public static function getOutputPrefix() + { + return "TrackingAPI_SetVisitorId"; + } + /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -46,5 +56,4 @@ class Test_Piwik_Integration_TrackingAPI_SetVisitorId extends IntegrationTestCas } } -Test_Piwik_Integration_TrackingAPI_SetVisitorId::$fixture = new Test_Piwik_Fixture_FewVisitsWithSetVisitorId(); - +TrackingAPISetVisitorIdTest::$fixture = new FewVisitsWithSetVisitorId(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TransitionsTest.php b/tests/PHPUnit/Integration/TransitionsTest.php index aaf7edff7001fe73905101a977ed4c811c8b5d6e..7bb55b9f56bccf309edad06c5013ee9cdd822dd5 100644 --- a/tests/PHPUnit/Integration/TransitionsTest.php +++ b/tests/PHPUnit/Integration/TransitionsTest.php @@ -1,15 +1,27 @@ <?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\SomeVisitsManyPageviewsWithTransitions; /** * Tests the transitions plugin. + * + * @group TransitionsTest + * @group Integration */ -class Test_Piwik_Integration_Transitions extends IntegrationTestCase +class TransitionsTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -76,5 +88,4 @@ class Test_Piwik_Integration_Transitions extends IntegrationTestCase } } -Test_Piwik_Integration_Transitions::$fixture = new Test_Piwik_Fixture_SomeVisitsManyPageviewsWithTransitions(); - +TransitionsTest::$fixture = new SomeVisitsManyPageviewsWithTransitions(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisabledTest.php b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php similarity index 85% rename from tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisabledTest.php rename to tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php index 154acdb64714fccc8f1a3f42365b375a0641bb1f..747b733a9c62e31553dc6611c3d55f0e7ff76940 100755 --- a/tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisabledTest.php +++ b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php @@ -5,18 +5,23 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoSitesTwoVisitorsDifferentDays; /** * Tests IndexedBySite optimizations when archiving is disabled. + * + * @group TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest + * @group Integration */ -class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisabled extends IntegrationTestCase +class TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration - * */ public function testApi($api, $params) { @@ -56,7 +61,7 @@ class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisa 'testSuffix' => '_disabledAfter')), - // Testing this particular bug: http://dev.piwik.org/trac/ticket/4532 + // Testing this particular bug: https://github.com/piwik/piwik/issues/4532 // ENABLE ARCHIVING and Process this custom date range. array('VisitsSummary.get', array('idSite' => 'all', 'date' => $dateRange, @@ -83,7 +88,5 @@ class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisa } } -Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisabled::$fixture = - new Test_Piwik_Fixture_TwoSitesTwoVisitorsDifferentDays(); -Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisabled::$fixture->allowConversions = true; - +TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest::$fixture = new TwoSitesTwoVisitorsDifferentDays(); +TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest::$fixture->allowConversions = true; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDays_ConversionsTest.php b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php similarity index 89% rename from tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDays_ConversionsTest.php rename to tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php index 00972de40baa99e9a006ef163286f6a1fc466194..9557cba7047ec21072aefcad11dc1c4317484880 100755 --- a/tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDays_ConversionsTest.php +++ b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php @@ -5,23 +5,27 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; use Piwik\Plugins\Goals\Archiver; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoSitesTwoVisitorsDifferentDays; require_once 'Goals/Goals.php'; /** * Same as TwoVisitors_twoWebsites_differentDays but with goals that convert * on every url. + * + * @group TwoVisitorsTwoWebsitesDifferentDaysConversionsTest + * @group Integration */ -class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_Conversions extends IntegrationTestCase +class TwoVisitorsTwoWebsitesDifferentDaysConversionsTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration - * */ public function testApi($api, $params) { @@ -111,7 +115,5 @@ class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_Conversions e } } -Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_Conversions::$fixture = - new Test_Piwik_Fixture_TwoSitesTwoVisitorsDifferentDays(); -Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_Conversions::$fixture->allowConversions = true; - +TwoVisitorsTwoWebsitesDifferentDaysConversionsTest::$fixture = new TwoSitesTwoVisitorsDifferentDays(); +TwoVisitorsTwoWebsitesDifferentDaysConversionsTest::$fixture->allowConversions = true; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDaysTest.php b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysTest.php similarity index 91% rename from tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDaysTest.php rename to tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysTest.php index e19490274b25c101d7ca5ccc8110428be13b73aa..f4c14d35690aa0a3cf2eaf15b0e2394de7651295 100755 --- a/tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDaysTest.php +++ b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysTest.php @@ -5,6 +5,10 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoSitesTwoVisitorsDifferentDays; /** * tests Tracker several websites, different days. @@ -14,14 +18,14 @@ * And testing empty URL and empty Page name request * Also testing a click on a mailto counted as outlink * Also testing metadata API for multiple periods + * + * @group TwoVisitorsTwoWebsitesDifferentDaysTest + * @group Integration */ -class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays extends IntegrationTestCase +class TwoVisitorsTwoWebsitesDifferentDaysTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition - /** - * @group Integration - */ public function testImagesIncludedInTests() { $this->alertWhenImagesExcludedFromTests(); @@ -29,7 +33,6 @@ class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays extends Integ /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -106,6 +109,4 @@ class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays extends Integ } } -Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays::$fixture = - new Test_Piwik_Fixture_TwoSitesTwoVisitorsDifferentDays(); - +TwoVisitorsTwoWebsitesDifferentDaysTest::$fixture = new TwoSitesTwoVisitorsDifferentDays(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentContainsTest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentContainsTest.php similarity index 79% rename from tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentContainsTest.php rename to tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentContainsTest.php index 3b6f63bb2632870f349936433316d76b99130bc4..1f31497a530780460615a97ef304c5d1ad35e8f6 100755 --- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentContainsTest.php +++ b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentContainsTest.php @@ -5,11 +5,18 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables; /** * Tests use of custom variable segments. + * + * @group Integration + * @group TwoVisitsWithCustomVariablesSegmentContainsTest */ -class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentContains extends IntegrationTestCase +class TwoVisitsWithCustomVariablesSegmentContainsTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition @@ -20,7 +27,6 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentContains extend /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -57,7 +63,5 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentContains extend } } -Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentContains::$fixture - = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables(); -Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentContains::$fixture->doExtraQuoteTests = false; - +TwoVisitsWithCustomVariablesSegmentContainsTest::$fixture = new TwoVisitsWithCustomVariables(); +TwoVisitsWithCustomVariablesSegmentContainsTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoalDataTest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php similarity index 72% rename from tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoalDataTest.php rename to tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php index b4e7c3d2fcf899523373bb8c72cc565877dcc3de..d800deca65dd719eaf193ec5cd591e1df373018d 100755 --- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoalDataTest.php +++ b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php @@ -5,14 +5,21 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; -class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoalData extends IntegrationTestCase +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables; + +/** + * @group Integration + * @group TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest + */ +class TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -43,7 +50,5 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoal } } -Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoalData::$fixture - = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables(); -Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoalData::$fixture->doExtraQuoteTests = false; - +TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest::$fixture = new TwoVisitsWithCustomVariables(); +TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchNONETest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php similarity index 83% rename from tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchNONETest.php rename to tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php index 9d9056709f4b82e3296ac2cfb24fb2461e6f5f59..1c0af3449ac758f29c2a749b1bc38223c04ad1e3 100755 --- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchNONETest.php +++ b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php @@ -5,18 +5,25 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\Plugins\API\API; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables; +use Piwik\Tests\Fixture; /** * testing a segment containing all supported fields + * + * @group Integration + * @group TwoVisitsWithCustomVariablesSegmentMatchNONETest */ -class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchNONE extends IntegrationTestCase +class TwoVisitsWithCustomVariablesSegmentMatchNONETest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -82,7 +89,5 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchNONE exten } } -Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchNONE::$fixture - = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables(); -Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchNONE::$fixture->doExtraQuoteTests = false; - +TwoVisitsWithCustomVariablesSegmentMatchNONETest::$fixture = new TwoVisitsWithCustomVariables(); +TwoVisitsWithCustomVariablesSegmentMatchNONETest::$fixture->doExtraQuoteTests = false; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchVisitorTypeTest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php similarity index 88% rename from tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchVisitorTypeTest.php rename to tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php index d5181804f67b8abbc89eed23de6bc815a87961e9..50c76d3a16f858272db39d7fef805af9ba658ce7 100755 --- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchVisitorTypeTest.php +++ b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php @@ -5,19 +5,25 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\Common; use Piwik\Db; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables; /** * Tests use of custom variable segments. + * + * @group Integration + * @group TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest */ -class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchVisitorType extends IntegrationTestCase +class TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -104,6 +110,5 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchVisitorTyp } } -Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchVisitorType::$fixture - = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables(); -Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchVisitorType::$fixture->doExtraQuoteTests = false; \ No newline at end of file +TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest::$fixture = new TwoVisitsWithCustomVariables(); +TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesTest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesTest.php index b2a8ded3fc33a3f9f7bdf495830124d9aef9f3ce..a9fafeddb81355174310c563e98668fd25c0ddd9 100755 --- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesTest.php +++ b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesTest.php @@ -5,11 +5,18 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables; /** * Tests w/ two visits & custom variables. + * + * @group TwoVisitsWithCustomVariablesTest + * @group Integration */ -class Test_Piwik_Integration_TwoVisitsWithCustomVariables extends IntegrationTestCase +class TwoVisitsWithCustomVariablesTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition @@ -41,7 +48,6 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables extends IntegrationTes /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -54,5 +60,4 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables extends IntegrationTes } } -Test_Piwik_Integration_TwoVisitsWithCustomVariables::$fixture = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables(); - +TwoVisitsWithCustomVariablesTest::$fixture = new TwoVisitsWithCustomVariables(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/UrlNormalizationTest.php b/tests/PHPUnit/Integration/UrlNormalizationTest.php index 608681348abe4b7f245b6db55480c7d8ab287489..867fdcad6023f9c7ca833e1d17990c68c452ad78 100644 --- a/tests/PHPUnit/Integration/UrlNormalizationTest.php +++ b/tests/PHPUnit/Integration/UrlNormalizationTest.php @@ -1,18 +1,30 @@ <?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +namespace Piwik\Tests\Integration; + use Piwik\Common; use Piwik\Db; use Piwik\Tracker\Action; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\OneVisitWithAbnormalPageviewUrls; /** * Tests the URL normalization. + * + * @group Integration + * @group UrlNormalizationTest */ -class Test_Piwik_Integration_UrlNormalization extends IntegrationTestCase +class UrlNormalizationTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -80,8 +92,7 @@ class Test_Piwik_Integration_UrlNormalization extends IntegrationTestCase } /** - * @@depends testApi - * @group Integration + * @depends testApi */ public function testCheckPostConditions() { @@ -109,5 +120,4 @@ class Test_Piwik_Integration_UrlNormalization extends IntegrationTestCase } } -Test_Piwik_Integration_UrlNormalization::$fixture = new Test_Piwik_Fixture_OneVisitWithAbnormalPageviewUrls(); - +UrlNormalizationTest::$fixture = new OneVisitWithAbnormalPageviewUrls(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/VisitsInPast_InvalidateOldReportsTest.php b/tests/PHPUnit/Integration/VisitsInPastInvalidateOldReportsTest.php similarity index 94% rename from tests/PHPUnit/Integration/VisitsInPast_InvalidateOldReportsTest.php rename to tests/PHPUnit/Integration/VisitsInPastInvalidateOldReportsTest.php index 6387c3bcf60ba8bdba6c3dcf85b1dae331d59e81..aed03b934358ef63c05b03f125d2a63f884fda46 100644 --- a/tests/PHPUnit/Integration/VisitsInPast_InvalidateOldReportsTest.php +++ b/tests/PHPUnit/Integration/VisitsInPastInvalidateOldReportsTest.php @@ -5,18 +5,25 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Integration; + use Piwik\API\Request; +use Piwik\Tests\IntegrationTestCase; +use Piwik\Tests\Fixtures\TwoSitesVisitsInPast; +use Exception; /** * Track visits before website creation date and test that Piwik handles them correctly. + * + * @group Integration + * @group VisitsInPastInvalidateOldReportsTest */ -class Test_Piwik_Integration_VisitsInPast_InvalidateOldReports extends IntegrationTestCase +class VisitsInPastInvalidateOldReportsTest extends IntegrationTestCase { public static $fixture = null; // initialized below class definition /** * @dataProvider getApiForTesting - * @group Integration */ public function testApi($api, $params) { @@ -59,7 +66,6 @@ class Test_Piwik_Integration_VisitsInPast_InvalidateOldReports extends Integrati /** * @depends testApi * @dataProvider getAnotherApiForTesting - * @group Integration */ public function testAnotherApi($api, $params) { @@ -133,5 +139,4 @@ class Test_Piwik_Integration_VisitsInPast_InvalidateOldReports extends Integrati } } -Test_Piwik_Integration_VisitsInPast_InvalidateOldReports::$fixture = new Test_Piwik_Fixture_TwoSitesVisitsInPast(); - +VisitsInPastInvalidateOldReportsTest::$fixture = new TwoSitesVisitsInPast(); \ No newline at end of file diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml index 17728cab1765b18f758bf918a7a2ec5d9b75185b..8cedb2f9a9ebc557bffec6da07b362d729dde595 100644 --- a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml +++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml @@ -5,8 +5,8 @@ <nb_visits>1</nb_visits> <nb_uniq_visitors>1</nb_uniq_visitors> <nb_hits>1</nb_hits> - <sum_time_spent>0</sum_time_spent> - <avg_time_on_page>0</avg_time_on_page> + <sum_time_spent>36</sum_time_spent> + <avg_time_on_page>36</avg_time_on_page> <bounce_rate>0%</bounce_rate> <exit_rate>0%</exit_rate> <url>http://example.org/dir2/sub/0/file.php</url> diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml index f5d57d7a79d31e2b8e97837f52c8576073bd11c1..3634faa18a5366da9943fe839ae5c8e124b2c1ed 100644 --- a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml +++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml @@ -2,15 +2,15 @@ <result> <row> <label>dir</label> - <nb_visits>2</nb_visits> - <nb_hits>2</nb_hits> - <sum_time_spent>684</sum_time_spent> - <nb_hits_with_time_generation>2</nb_hits_with_time_generation> + <nb_visits>4</nb_visits> + <nb_hits>4</nb_hits> + <sum_time_spent>720</sum_time_spent> + <nb_hits_with_time_generation>4</nb_hits_with_time_generation> <min_time_generation>0.123</min_time_generation> - <max_time_generation>0.153</max_time_generation> - <avg_time_on_page>342</avg_time_on_page> + <max_time_generation>0.333</max_time_generation> + <avg_time_on_page>180</avg_time_on_page> <bounce_rate>0%</bounce_rate> <exit_rate>0%</exit_rate> - <avg_time_generation>0.138</avg_time_generation> + <avg_time_generation>0.211</avg_time_generation> </row> </result> \ No newline at end of file diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml index 9ece84f6b1eb2c8d17d8e459fd2c8eb2ffc13fc2..b648ce6807ec8d85b1148524ac79b62bf2c61332 100644 --- a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml +++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml @@ -3,16 +3,16 @@ <result date="2010-03-06"> <row> <label>dir</label> - <nb_visits>2</nb_visits> - <nb_hits>2</nb_hits> - <sum_time_spent>684</sum_time_spent> - <nb_hits_with_time_generation>2</nb_hits_with_time_generation> + <nb_visits>4</nb_visits> + <nb_hits>4</nb_hits> + <sum_time_spent>720</sum_time_spent> + <nb_hits_with_time_generation>4</nb_hits_with_time_generation> <min_time_generation>0.123</min_time_generation> - <max_time_generation>0.153</max_time_generation> - <avg_time_on_page>342</avg_time_on_page> + <max_time_generation>0.333</max_time_generation> + <avg_time_on_page>180</avg_time_on_page> <bounce_rate>0%</bounce_rate> <exit_rate>0%</exit_rate> - <avg_time_generation>0.138</avg_time_generation> + <avg_time_generation>0.211</avg_time_generation> </row> </result> <result date="2010-03-07" /> diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml index ea194078ed53fa74fb3f687b3cfaf081052d7ef9..8a58d46ddf4777c6e3abb4b91c3a36b14dad9d47 100644 --- a/tests/PHPUnit/Integration/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml +++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml @@ -4,8 +4,8 @@ <label><>&\"the pdo extension is required for this adapter but the extension is not loaded</label> <nb_uniq_visitors>1</nb_uniq_visitors> <nb_visits>1</nb_visits> - <nb_actions>7</nb_actions> - <max_actions>7</max_actions> + <nb_actions>9</nb_actions> + <max_actions>9</max_actions> <sum_visit_length>1441</sum_visit_length> <bounce_count>0</bounce_count> <nb_visits_converted>0</nb_visits_converted> diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml new file mode 100644 index 0000000000000000000000000000000000000000..04dac45ecd1d908a44027faf28817e85d809751d --- /dev/null +++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>@one@</label> + <nb_visits>1</nb_visits> + <nb_hits>1</nb_hits> + <sum_time_spent>36</sum_time_spent> + <nb_hits_with_time_generation>1</nb_hits_with_time_generation> + <min_time_generation>0.233</min_time_generation> + <max_time_generation>0.233</max_time_generation> + <avg_time_on_page>36</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>0%</exit_rate> + <avg_time_generation>0.233</avg_time_generation> + </row> +</result> \ No newline at end of file diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml new file mode 100644 index 0000000000000000000000000000000000000000..1517efab300e3b881d42d1ce49064450690a9fe8 --- /dev/null +++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label> @one@</label> + <nb_visits>1</nb_visits> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <nb_hits_with_time_generation>1</nb_hits_with_time_generation> + <min_time_generation>0.333</min_time_generation> + <max_time_generation>0.333</max_time_generation> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>0%</exit_rate> + <avg_time_generation>0.333</avg_time_generation> + </row> +</result> \ No newline at end of file diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml new file mode 100644 index 0000000000000000000000000000000000000000..2a3958ceba34cd2dfaeef08f45ef3b621dca52db --- /dev/null +++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>/subdir</label> + <nb_visits>1</nb_visits> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_hits>1</nb_hits> + <sum_time_spent>0</sum_time_spent> + <nb_hits_with_time_generation>1</nb_hits_with_time_generation> + <min_time_generation>0.333</min_time_generation> + <max_time_generation>0.333</max_time_generation> + <avg_time_on_page>0</avg_time_on_page> + <bounce_rate>0%</bounce_rate> + <exit_rate>0%</exit_rate> + <avg_time_generation>0.333</avg_time_generation> + <url>http://example.org/dir/subdir</url> + </row> +</result> \ No newline at end of file diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml index bbbd02dd81d7f6cae96ac5e4b3b20fa2a8e0efb7..4cec8aa9aa1dcec4dac5d5fe85e1cf079d6b712a 100644 --- a/tests/PHPUnit/Integration/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml +++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml @@ -11,7 +11,7 @@ <max_time_generation>0.523</max_time_generation> <entry_nb_uniq_visitors>1</entry_nb_uniq_visitors> <entry_nb_visits>1</entry_nb_visits> - <entry_nb_actions>7</entry_nb_actions> + <entry_nb_actions>9</entry_nb_actions> <entry_sum_visit_length>1441</entry_sum_visit_length> <entry_bounce_count>0</entry_bounce_count> <avg_time_on_page>720</avg_time_on_page> diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml index 667e9fcd902e28c6b02b15632814089043a34a7e..afffc60a48240da5d0c60b72e9442bce17f3c314 100644 --- a/tests/PHPUnit/Integration/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml +++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml @@ -5,16 +5,16 @@ <nb_visits>1</nb_visits> <nb_uniq_visitors>1</nb_uniq_visitors> <nb_hits>4</nb_hits> - <sum_time_spent>1080</sum_time_spent> + <sum_time_spent>1116</sum_time_spent> <nb_hits_with_time_generation>3</nb_hits_with_time_generation> <min_time_generation>0.123</min_time_generation> <max_time_generation>1.233</max_time_generation> <entry_nb_uniq_visitors>1</entry_nb_uniq_visitors> <entry_nb_visits>1</entry_nb_visits> - <entry_nb_actions>7</entry_nb_actions> + <entry_nb_actions>9</entry_nb_actions> <entry_sum_visit_length>1441</entry_sum_visit_length> <entry_bounce_count>0</entry_bounce_count> - <avg_time_on_page>1080</avg_time_on_page> + <avg_time_on_page>1116</avg_time_on_page> <bounce_rate>0%</bounce_rate> <exit_rate>0%</exit_rate> <avg_time_generation>0.626</avg_time_generation> diff --git a/tests/PHPUnit/IntegrationTestCase.php b/tests/PHPUnit/IntegrationTestCase.php index aa4ca74026649e49bf3c60e6ab4a673895f65b6e..abe5659c43ea729be6eaba18013b4018d1c15927 100755 --- a/tests/PHPUnit/IntegrationTestCase.php +++ b/tests/PHPUnit/IntegrationTestCase.php @@ -5,6 +5,8 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests; + use Piwik\API\DocumentationGenerator; use Piwik\API\Proxy; use Piwik\API\Request; @@ -18,6 +20,7 @@ use Piwik\ReportRenderer; use Piwik\Translate; use Piwik\UrlHelper; use Piwik\Log; +use PHPUnit_Framework_TestCase; require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php'; @@ -200,7 +203,7 @@ abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase ) ); - if(Fixture::canImagesBeIncludedInScheduledReports()) { + if (Fixture::canImagesBeIncludedInScheduledReports()) { // PDF Scheduled Report // tests/PHPUnit/Integration/processed/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf array_push( diff --git a/tests/PHPUnit/bootstrap.php b/tests/PHPUnit/bootstrap.php index ea2d0aa3aa704ecf988ddf693c1dfae79db9a550..4058a867d4ade70529f0bb1fd2a5672a87b0f126 100644 --- a/tests/PHPUnit/bootstrap.php +++ b/tests/PHPUnit/bootstrap.php @@ -78,7 +78,7 @@ Try again. -> If you still get this message, you can work around it by specifying Host + Request_Uri at the top of this file tests/PHPUnit/bootstrap.php. <-"; exit(1); } - $baseUrl = Fixture::getRootUrl(); + $baseUrl = \Piwik\Tests\Fixture::getRootUrl(); \Piwik\SettingsPiwik::checkPiwikServerWorking($baseUrl, $acceptInvalidSSLCertificates = true); } diff --git a/tests/javascript/SQLite.php b/tests/javascript/SQLite.php index c357c7febf967a1abb5201e142575877c009d944..5b4a3b3343ae127ab33da9c4e43a80e5835ffbf7 100644 --- a/tests/javascript/SQLite.php +++ b/tests/javascript/SQLite.php @@ -5,7 +5,6 @@ * SQLite shim * * @link http://piwik.org - * @source http://dev.piwik.org/trac/browser/trunk/tests/javascript/SQLite.php * @license http://www.opensource.org/licenses/bsd-license.php Simplified BSD */ if (class_exists('SQLite3')) diff --git a/tests/resources/OmniFixture-dump.sql.gz b/tests/resources/OmniFixture-dump.sql.gz new file mode 100644 index 0000000000000000000000000000000000000000..9c8dc1b75a3c90faa9e9dbf7cc83d3b104f3263a Binary files /dev/null and b/tests/resources/OmniFixture-dump.sql.gz differ diff --git a/tests/resources/extractSearchEngineInformationFromUrlTests.yml b/tests/resources/extractSearchEngineInformationFromUrlTests.yml index 60daf9da832c936a50b40b50e6c8226c724f8299..345bf04a43575b4b6275a1eebed9bc417f5d7088 100644 --- a/tests/resources/extractSearchEngineInformationFromUrlTests.yml +++ b/tests/resources/extractSearchEngineInformationFromUrlTests.yml @@ -32,7 +32,7 @@ keywords: '<> &test; piwik "' # testing Baidu special case (several variable names possible, and custom encoding) -# see http://dev.piwik.org/trac/ticket/589 +# see https://github.com/piwik/piwik/issues/589 # keyword is in "wd" - url: 'http://www.baidu.com/s?ie=gb2312&bs=%BF%D5%BC%E4+hao123+%7C+%B8%FC%B6%E0%3E%3E&sr=&z=&cl=3&f=8&tn=baidu&wd=%BF%D5%BC%E4+%BA%C3123+%7C+%B8%FC%B6%E0%3E%3E&ct=0' @@ -328,7 +328,7 @@ keywords: false # Google images no keyword -- url: 'http://www.google.com/imgres?hl=en&client=ubuntu&hs=xDb&sa=X&channel=fs&biw=1920&bih=1084&tbm=isch&prmd=imvns&tbnid=5i7iz7u4LPSSrM:&imgrefurl=http://dev.piwik.org/trac/wiki/HowToSetupDevelopmentEnvironmentWindows&docid=tWN9OesMyOTqsM&imgurl=http://dev.piwik.org/trac/raw-attachment/wiki/HowToSetupDevelopmentEnvironmentWindows/eclipse-preview.jpg&w=1000&h=627&ei=pURoT67BEdT74QTUzYiSCQ&zoom=1&iact=hc&vpx=1379&vpy=548&dur=513&hovh=178&hovw=284&tx=134&ty=105&sig=108396332168858896950&page=1&tbnh=142&tbnw=227&start=0&ndsp=37&ved=1t:429,r:5,s:0' +- url: 'http://www.google.com/imgres?hl=en&client=ubuntu&hs=xDb&sa=X&channel=fs&biw=1920&bih=1084&tbm=isch&prmd=imvns&tbnid=5i7iz7u4LPSSrM:&imgrefurl=http://helloworld/trac/wiki/HowToSetupDevelopmentEnvironmentWindows&docid=tWN9OesMyOTqsM&imgurl=http://helloworld.org/trac/raw-attachment/wiki/HowToSetupDevelopmentEnvironmentWindows/eclipse-preview.jpg&w=1000&h=627&ei=pURoT67BEdT74QTUzYiSCQ&zoom=1&iact=hc&vpx=1379&vpy=548&dur=513&hovh=178&hovw=284&tx=134&ty=105&sig=108396332168858896950&page=1&tbnh=142&tbnw=227&start=0&ndsp=37&ved=1t:429,r:5,s:0' engine: 'Google Images' keywords: false