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@gmail.com>2015-12-15 00:37:24 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-12-15 03:59:36 +0300
commit98514dba52b5a230dc10de294d9cf7146b27ec87 (patch)
tree7b2f7e25029d0bc1d717dfafe4b11909041c016f /tests/PHPUnit/System/TrackGoalsOneConversionPerVisitTest.php
parent6cd4dda2b479bf39b6c91669a7d68512577ea879 (diff)
fixes #9194 fix "goal can be only converted once per visit" is not respected when segmenting goals with a log_link_visit_action segment
Diffstat (limited to 'tests/PHPUnit/System/TrackGoalsOneConversionPerVisitTest.php')
-rwxr-xr-xtests/PHPUnit/System/TrackGoalsOneConversionPerVisitTest.php64
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/PHPUnit/System/TrackGoalsOneConversionPerVisitTest.php b/tests/PHPUnit/System/TrackGoalsOneConversionPerVisitTest.php
new file mode 100755
index 0000000000..478a4a1152
--- /dev/null
+++ b/tests/PHPUnit/System/TrackGoalsOneConversionPerVisitTest.php
@@ -0,0 +1,64 @@
+<?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\Framework\TestCase\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
+
+/**
+ * @group Plugins
+ * @group TrackGoalsOneConversionPerVisitTest
+ */
+class TrackGoalsOneConversionPerVisitTest extends SystemTestCase
+{
+ /**
+ * @var TwoVisitsWithCustomVariables
+ */
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $apiToCall = array('Goals.get');
+
+ return array(
+ array($apiToCall, array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day'))),
+ // test for https://github.com/piwik/piwik/issues/9194 requesting log_conversion with log_link_visit_action segment
+ array($apiToCall, array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'segment' => 'pageUrl=@/',
+ 'testSuffix' => '_withLogLinkVisitActionSegment'
+ )),
+ array($apiToCall, array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'segment' => 'visitCount>=1;pageUrl=@/',
+ 'testSuffix' => '_withLogLinkVisitActionAndLogVisitSegment'
+ )),
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'trackGoals_oneConversionPerVisit';
+ }
+}
+
+TrackGoalsOneConversionPerVisitTest::$fixture = new TwoVisitsWithCustomVariables();
+TrackGoalsOneConversionPerVisitTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file