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-07-03 03:54:27 +0300
committersgiehl <stefan@piwik.org>2015-10-06 18:25:13 +0300
commit9ba8f216fd7856ce5fef06bf82ecb8f8a2e7e630 (patch)
tree6ce07d18a85d00b39ab720abe042361c0775aead /tests/PHPUnit/Fixtures
parent8ccc9dc05da021325cdbf141a548637fa52f16b2 (diff)
generate pages instead of implementing them in each controller
Diffstat (limited to 'tests/PHPUnit/Fixtures')
-rw-r--r--tests/PHPUnit/Fixtures/OmniFixture.php13
-rw-r--r--tests/PHPUnit/Fixtures/UITestFixture.php17
2 files changed, 16 insertions, 14 deletions
diff --git a/tests/PHPUnit/Fixtures/OmniFixture.php b/tests/PHPUnit/Fixtures/OmniFixture.php
index 123e214bd3..dd680e9085 100644
--- a/tests/PHPUnit/Fixtures/OmniFixture.php
+++ b/tests/PHPUnit/Fixtures/OmniFixture.php
@@ -73,12 +73,15 @@ class OmniFixture extends Fixture
}
}
- $this->now = $this->fixtures['Piwik\\Tests\\Fixtures\\ManySitesImportedLogsWithXssAttempts']->now;
- // 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);
+ if (!empty($this->fixtures['Piwik\\Tests\\Fixtures\\ManySitesImportedLogsWithXssAttempts'])) {
+ $this->now = $this->fixtures['Piwik\\Tests\\Fixtures\\ManySitesImportedLogsWithXssAttempts']->now;
+
+ // 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)
diff --git a/tests/PHPUnit/Fixtures/UITestFixture.php b/tests/PHPUnit/Fixtures/UITestFixture.php
index eb35b24114..34c63a22e9 100644
--- a/tests/PHPUnit/Fixtures/UITestFixture.php
+++ b/tests/PHPUnit/Fixtures/UITestFixture.php
@@ -8,6 +8,7 @@
namespace Piwik\Tests\Fixtures;
use Exception;
+use Piwik\API\Request;
use Piwik\AssetManager;
use Piwik\Access;
use Piwik\Common;
@@ -22,9 +23,6 @@ use Piwik\Plugins\UserCountry\LocationProvider;
use Piwik\Plugins\UsersManager\API as UsersManagerAPI;
use Piwik\Plugins\SitesManager\API as SitesManagerAPI;
use Piwik\Tests\Framework\Fixture;
-use Piwik\WidgetsList;
-use Piwik\Tests\Framework\OverrideLogin;
-use Piwik\Tests\Framework\TestCase\SystemTestCase;
/**
* Fixture for UI tests.
@@ -222,10 +220,10 @@ class UITestFixture extends SqlDump
$_GET['token_auth'] = Fixture::getTokenAuth();
// collect widgets & sort them so widget order is not important
- $allWidgets = array();
- foreach (WidgetsList::get() as $category => $widgets) {
- $allWidgets = array_merge($allWidgets, $widgets);
- }
+ $allWidgets = Request::processRequest('API.getWidgetMetadata', array(
+ 'idSite' => 1
+ ));
+
usort($allWidgets, function ($lhs, $rhs) {
return strcmp($lhs['uniqueId'], $rhs['uniqueId']);
});
@@ -290,11 +288,12 @@ class UITestFixture extends SqlDump
$dashboard = array(
array(
array(
- 'uniqueId' => "widgetVisitsSummarygetEvolutionGraphcolumnsArray",
+ 'uniqueId' => "widgetVisitsSummarygetEvolutionGraphforceView1viewDataTablegraphEvolution",
'parameters' => array(
'module' => 'VisitsSummary',
'action' => 'getEvolutionGraph',
- 'columns' => 'nb_visits'
+ 'forceView' => '1',
+ 'viewDataTable' => 'graphEvolution'
)
)
),