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

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-10-05 15:05:47 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-10-05 15:05:47 +0400
commit5a1eab97f54b44f57356b4276b9c9df2a8eef51b (patch)
tree83864ece2806ccf6e6bb49abf3fd65de92c13ad8 /tests/PHPUnit/System/NoVisitTest.php
parent19bcd2d262343eae9d553378e4c66ce7e033b4d8 (diff)
refs #5940 put tests in correct folders, better testsuite names, some tests still fail and I cannot figure out why
Diffstat (limited to 'tests/PHPUnit/System/NoVisitTest.php')
-rwxr-xr-xtests/PHPUnit/System/NoVisitTest.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/PHPUnit/System/NoVisitTest.php b/tests/PHPUnit/System/NoVisitTest.php
new file mode 100755
index 0000000000..4a81736073
--- /dev/null
+++ b/tests/PHPUnit/System/NoVisitTest.php
@@ -0,0 +1,53 @@
+<?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\System;
+
+use Piwik\Tests\SystemTestCase;
+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 Core
+ */
+class NoVisitTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ // this will output empty XML result sets as no visit was tracked
+ return array(
+ array('all', array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime)),
+ array('all', array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day', 'week'),
+ 'setDateLastN' => true,
+ 'testSuffix' => '_PeriodIsLast')),
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'noVisit';
+ }
+}
+
+NoVisitTest::$fixture = new InvalidVisits(); \ No newline at end of file