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/CsvExportTest.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/CsvExportTest.php')
-rwxr-xr-xtests/PHPUnit/System/CsvExportTest.php84
1 files changed, 84 insertions, 0 deletions
diff --git a/tests/PHPUnit/System/CsvExportTest.php b/tests/PHPUnit/System/CsvExportTest.php
new file mode 100755
index 0000000000..48c9342f8e
--- /dev/null
+++ b/tests/PHPUnit/System/CsvExportTest.php
@@ -0,0 +1,84 @@
+<?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\TwoVisitsWithCustomVariables;
+
+/**
+ * Test CSV export with Expanded rows, Translated labels, Different languages
+ *
+ * @group CsvExportTest
+ * @group Core
+ */
+class CsvExportTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $dateTime = self::$fixture->dateTime;
+
+ $apiToCall = array('VisitsSummary.get', 'CustomVariables.getCustomVariables');
+
+ $enExtraParam = array('expanded' => 0, 'flat' => 1, 'include_aggregate_rows' => 0, 'translateColumnNames' => 1);
+
+ $deExtraParam = array('expanded' => 0, 'flat' => 1, 'include_aggregate_rows' => 1, 'translateColumnNames' => 1);
+
+ return array(
+ array($apiToCall, array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'format' => 'csv',
+ 'otherRequestParameters' => array('expanded' => 0, 'flat' => 0),
+ 'testSuffix' => '_xp0')),
+
+ array($apiToCall, array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'format' => 'csv',
+ 'otherRequestParameters' => $enExtraParam,
+ 'language' => 'en',
+ 'testSuffix' => '_xp1_inner0_trans-en')),
+
+ array($apiToCall, array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'format' => 'csv',
+ 'otherRequestParameters' => $deExtraParam,
+ 'language' => 'de',
+ 'testSuffix' => '_xp1_inner1_trans-de')),
+
+ array('Live.getLastVisitsDetails', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'format' => 'csv',
+ 'otherRequestParameters' => array(
+ 'hideColumns' => 'serverDate,actionDetails,serverTimestamp,serverTimePretty,'
+ . 'serverDatePretty,serverDatePrettyFirstAction,serverTimePrettyFirstAction,'
+ . 'goalTimePretty,serverTimePretty,visitorId,visitServerHour,date,'
+ . 'prettyDate,serverDateTimePrettyFirstAction'
+ )))
+ );
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'csvExport';
+ }
+}
+
+CsvExportTest::$fixture = new TwoVisitsWithCustomVariables();
+CsvExportTest::$fixture->visitorId = null;
+CsvExportTest::$fixture->useEscapedQuotes = false;
+CsvExportTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file