diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2018-09-17 00:35:15 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2018-09-17 00:35:15 +0300 |
commit | ca585d9905a831441a148285e8138040e8e07284 (patch) | |
tree | bb3c7e03912c89d2faae9c0a48d5ef9bd9e95e1f /plugins/SegmentEditor/tests/System | |
parent | f0a9628bccad7cbb0005669f39578b122849a573 (diff) |
When displaying unprocessed segment message, check for urlencoded segment. (#13415)
* When displaying unprocessed message, check for urlencoded segment.
* Add test.
Diffstat (limited to 'plugins/SegmentEditor/tests/System')
-rw-r--r-- | plugins/SegmentEditor/tests/System/UnprocessedSegmentsTest.php | 20 | ||||
-rw-r--r-- | plugins/SegmentEditor/tests/System/expected/test___VisitsSummary.get_autoArchiveSegmentUnprocessedEncoded.xml | 4 |
2 files changed, 24 insertions, 0 deletions
diff --git a/plugins/SegmentEditor/tests/System/UnprocessedSegmentsTest.php b/plugins/SegmentEditor/tests/System/UnprocessedSegmentsTest.php index e4d3d45c17..dbc7cae23b 100644 --- a/plugins/SegmentEditor/tests/System/UnprocessedSegmentsTest.php +++ b/plugins/SegmentEditor/tests/System/UnprocessedSegmentsTest.php @@ -87,6 +87,26 @@ class UnprocessedSegmentsTest extends IntegrationTestCase ]); } + public function test_apiOutput_whenUnprocessedAutoArchiveSegmentUsed_WithBrowserArchivingDisabled_AndEncodedSegment() + { + $idSegment = API::getInstance()->add('testsegment', self::TEST_SEGMENT, self::$fixture->idSite, $autoArchive = true); + + $storedSegment = API::getInstance()->get($idSegment); + $this->assertNotEmpty($storedSegment); + + Rules::setBrowserTriggerArchiving(false); + + $segments = Rules::getSegmentsToProcess([self::$fixture->idSite]); + $this->assertContains(self::TEST_SEGMENT, $segments); + + $this->runAnyApiTest('VisitsSummary.get', 'autoArchiveSegmentUnprocessedEncoded', [ + 'idSite' => self::$fixture->idSite, + 'date' => Date::factory(self::$fixture->dateTime)->toString(), + 'period' => 'week', + 'segment' => urlencode(self::TEST_SEGMENT), + ]); + } + public function test_apiOutput_whenPreprocessedSegmentUsed_WithBrowserArchivingDisabled() { $idSegment = API::getInstance()->add('testsegment', self::TEST_SEGMENT, self::$fixture->idSite, $autoArchive = true); diff --git a/plugins/SegmentEditor/tests/System/expected/test___VisitsSummary.get_autoArchiveSegmentUnprocessedEncoded.xml b/plugins/SegmentEditor/tests/System/expected/test___VisitsSummary.get_autoArchiveSegmentUnprocessedEncoded.xml new file mode 100644 index 0000000000..57b75e01db --- /dev/null +++ b/plugins/SegmentEditor/tests/System/expected/test___VisitsSummary.get_autoArchiveSegmentUnprocessedEncoded.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="These reports have no data, because the Segment you requested (testsegment) has not yet been processed by the system. Data for this Segment should become available in a few hours when processing completes. (If it does not, there may be a problem.) Please note that you can test whether your segment will work without having to wait for it to be processed by using the Live.getLastVisitsDetails API. When using this API method, you will see which users and actions were matched by your &segment= parameter. This can help you confirm your Segment matches the users and actions you expect it to." /> +</result>
\ No newline at end of file |