Skip to content

Commit

Permalink
Allow users of segment selector to manually change the selected segme…
Browse files Browse the repository at this point in the history
…nt and use reflection to filter fixtures used by OmniFixture.
  • Loading branch information
diosmosis committed Mar 25, 2014
1 parent c25f37c commit c626d8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/SegmentEditor/javascripts/Segmentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions tests/PHPUnit/Fixtures/OmniFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c626d8c

Please sign in to comment.