From c626d8c406dc072da95dbbc49d91550d193f53b1 Mon Sep 17 00:00:00 2001 From: diosmosis Date: Tue, 25 Mar 2014 07:19:51 +0000 Subject: [PATCH] Allow users of segment selector to manually change the selected segment and use reflection to filter fixtures used by OmniFixture. --- plugins/SegmentEditor/javascripts/Segmentation.js | 4 ++++ tests/PHPUnit/Fixtures/OmniFixture.php | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/plugins/SegmentEditor/javascripts/Segmentation.js b/plugins/SegmentEditor/javascripts/Segmentation.js index 5193eacccd7..1a3af211a4e 100644 --- a/plugins/SegmentEditor/javascripts/Segmentation.js +++ b/plugins/SegmentEditor/javascripts/Segmentation.js @@ -1195,6 +1195,10 @@ $(document).ready(function() { return this.impl.getSegment(); }, + setSegment: function (segment) { + return this.impl.setSegment(segment); + }, + rebuild: function () { this.impl.setAvailableSegments(this.props.availableSegments); this.impl.initHtml(); diff --git a/tests/PHPUnit/Fixtures/OmniFixture.php b/tests/PHPUnit/Fixtures/OmniFixture.php index e9de77b6745..e11096c2d73 100644 --- a/tests/PHPUnit/Fixtures/OmniFixture.php +++ b/tests/PHPUnit/Fixtures/OmniFixture.php @@ -9,6 +9,7 @@ use Piwik\Date; use Piwik\Tracker\Visit; +use \ReflectionClass; /** * This fixture is the combination of every other fixture defined by Piwik. Should be used @@ -42,6 +43,11 @@ public function __construct() && $className != "Piwik_Test_Fixture_SqlDump" && $className != "Piwik\\Tests\\Fixtures\\UpdaterTestFixture" ) { + $klassReflect = new ReflectionClass($className); + if (strpos($klassReflect->getFilename(), "tests/PHPUnit/UI")) { + continue; + } + $fixture = new $className(); if (!property_exists($fixture, 'dateTime')) { continue;