diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-10-05 15:05:47 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-10-05 15:05:47 +0400 |
commit | 5a1eab97f54b44f57356b4276b9c9df2a8eef51b (patch) | |
tree | 83864ece2806ccf6e6bb49abf3fd65de92c13ad8 /tests/PHPUnit/System/TransitionsTest.php | |
parent | 19bcd2d262343eae9d553378e4c66ce7e033b4d8 (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/TransitionsTest.php')
-rw-r--r-- | tests/PHPUnit/System/TransitionsTest.php | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/tests/PHPUnit/System/TransitionsTest.php b/tests/PHPUnit/System/TransitionsTest.php new file mode 100644 index 0000000000..e3ca1c4863 --- /dev/null +++ b/tests/PHPUnit/System/TransitionsTest.php @@ -0,0 +1,91 @@ +<?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\SomeVisitsManyPageviewsWithTransitions; + +/** + * Tests the transitions plugin. + * + * @group TransitionsTest + * @group Plugins + */ +class TransitionsTest extends SystemTestCase +{ + public static $fixture = null; // initialized below class definition + + /** + * @dataProvider getApiForTesting + */ + public function testApi($api, $params) + { + $this->runApiTests($api, $params); + } + + public function getApiForTesting() + { + $return = array(); + $return[] = array('Transitions.getTransitionsForPageUrl', array( + 'idSite' => self::$fixture->idSite, + 'date' => self::$fixture->dateTime, + 'periods' => array('day', 'month'), + 'testSuffix' => '_noLimit', + 'otherRequestParameters' => array( + 'pageUrl' => 'http://example.org/page/one.html', + ) + )); + $return[] = array('Transitions.getTransitionsForPageTitle', array( + 'idSite' => self::$fixture->idSite, + 'date' => self::$fixture->dateTime, + 'periods' => array('day', 'month'), + 'testSuffix' => '_noLimit', + 'otherRequestParameters' => array( + 'pageTitle' => 'page title - page/one.html', + ) + )); + + // test w/ pages that don't exist + $return[] = array('Transitions.getTransitionsForPageUrl', array( + 'idSite' => self::$fixture->idSite, + 'date' => self::$fixture->dateTime, + 'periods' => array('day', 'month'), + 'testSuffix' => '_noData', + 'otherRequestParameters' => array( + 'pageUrl' => 'http://example.org/not/a/page.html', + ) + )); + $return[] = array('Transitions.getTransitionsForPageTitle', array( + 'idSite' => self::$fixture->idSite, + 'date' => self::$fixture->dateTime, + 'periods' => array('day', 'month'), + 'testSuffix' => '_noData', + 'otherRequestParameters' => array( + 'pageTitle' => 'not a page title', + ) + )); + + $return[] = array('Transitions.getTransitionsForPageUrl', array( // test w/ limiting + 'idSite' => self::$fixture->idSite, + 'date' => self::$fixture->dateTime, + 'periods' => array('day', 'month'), + 'otherRequestParameters' => array( + 'pageUrl' => 'http://example.org/page/one.html', + 'limitBeforeGrouping' => 2 + ) + )); + return $return; + } + + public static function getOutputPrefix() + { + return 'Transitions'; + } +} + +TransitionsTest::$fixture = new SomeVisitsManyPageviewsWithTransitions();
\ No newline at end of file |