From e6d76246cb1b14ad7b07075ad8f78db485677e80 Mon Sep 17 00:00:00 2001 From: Lachlan Reynolds Date: Tue, 2 Jun 2026 11:51:06 +1200 Subject: [PATCH 1/3] Fix system tests [no_release] --- ...iables_SegmentPageTitleContains__Actions.getPageUrls_day.xml | 2 +- ...ariables_SegmentPageUrlContains__Actions.getPageUrls_day.xml | 2 +- ...ariables_SegmentPageUrlEndsWith__Actions.getPageUrls_day.xml | 2 +- ...iables_SegmentPageUrlStartsWith__Actions.getPageUrls_day.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageUrls_day.xml b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageUrls_day.xml index 2dae6b2..51f21a8 100644 --- a/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageUrls_day.xml +++ b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageUrls_day.xml @@ -97,7 +97,7 @@ 0 3 0.6666 - 0 + 1 2 0 diff --git a/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageUrls_day.xml b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageUrls_day.xml index 2dae6b2..51f21a8 100644 --- a/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageUrls_day.xml +++ b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageUrls_day.xml @@ -97,7 +97,7 @@ 0 3 0.6666 - 0 + 1 2 0 diff --git a/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlEndsWith__Actions.getPageUrls_day.xml b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlEndsWith__Actions.getPageUrls_day.xml index 2dae6b2..51f21a8 100644 --- a/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlEndsWith__Actions.getPageUrls_day.xml +++ b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlEndsWith__Actions.getPageUrls_day.xml @@ -97,7 +97,7 @@ 0 3 0.6666 - 0 + 1 2 0 diff --git a/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlStartsWith__Actions.getPageUrls_day.xml b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlStartsWith__Actions.getPageUrls_day.xml index f873185..1f23669 100644 --- a/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlStartsWith__Actions.getPageUrls_day.xml +++ b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlStartsWith__Actions.getPageUrls_day.xml @@ -99,7 +99,7 @@ 0 3 0.6666 - 0 + 1 2 0 From 54052e3181cc36acc5d94c4b43035424b19f3242 Mon Sep 17 00:00:00 2001 From: Lachlan Reynolds Date: Wed, 3 Jun 2026 10:50:43 +1200 Subject: [PATCH 2/3] Fix old test case --- ...sWithCustomVariablesSegmentContainsTest.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/System/TwoVisitsWithCustomVariablesSegmentContainsTest.php b/tests/System/TwoVisitsWithCustomVariablesSegmentContainsTest.php index 1095c96..fd673a0 100644 --- a/tests/System/TwoVisitsWithCustomVariablesSegmentContainsTest.php +++ b/tests/System/TwoVisitsWithCustomVariablesSegmentContainsTest.php @@ -51,26 +51,36 @@ public function getApiForTesting() $api[] = 'Actions.getPageTitles'; } + $olderThanMatomo5110b1 = version_compare(Version::VERSION, '5.11.0-b1', '<'); + $segmentsToTest = [ // array( SegmentString , TestSuffix , Array of API to test) ["pageTitle=@*_)%", '_SegmentPageTitleContainsStrangeCharacters', ['VisitsSummary.get']], - ["pageUrl=@user/profile", '_SegmentPageUrlContains', $api], - ["pageTitle=@Profile pa", '_SegmentPageTitleContains', $api], ["pageUrl!@user/profile", '_SegmentPageUrlExcludes', $api], ["pageTitle!@Profile pa", '_SegmentPageTitleExcludes', $api], ]; + if (version_compare(Version::VERSION, '4.13.1-rc1', '>=')) { + $segmentsToTest[] = ["pageUrl=@user/profile", '_SegmentPageUrlContains', ['VisitsSummary.get', 'Actions.getPageTitles']]; + $segmentsToTest[] = ["pageUrl=@user/profile", '_SegmentPageUrlContains' . ($olderThanMatomo5110b1 ? '_old' : ''), ['Actions.getPageUrls']]; + $segmentsToTest[] = ["pageTitle=@Profile pa", '_SegmentPageTitleContains', ['VisitsSummary.get', 'Actions.getPageTitles']]; + $segmentsToTest[] = ["pageTitle=@Profile pa", '_SegmentPageTitleContains' . ($olderThanMatomo5110b1 ? '_old' : ''), ['Actions.getPageUrls']]; + } else { + $segmentsToTest[] = ["pageUrl=@user/profile", '_SegmentPageUrlContains', $api]; + $segmentsToTest[] = ["pageTitle=@Profile pa", '_SegmentPageTitleContains', $api]; + } + if (version_compare(Version::VERSION, '4.13.1-rc1', '>=')) { // goals for pages reports had been changed in 4.13.1, so we don't perform this tests before $segmentsToTest[] = ["pageTitle=@*_)%", '_SegmentPageTitleContainsStrangeCharacters', ['Actions.getPageTitles']]; // starts with - $segmentsToTest[] = ['pageUrl=^example.org/home', '_SegmentPageUrlStartsWith', ['Actions.getPageUrls']]; + $segmentsToTest[] = ['pageUrl=^example.org/home', '_SegmentPageUrlStartsWith' . ($olderThanMatomo5110b1 ? '_old' : ''), ['Actions.getPageUrls']]; $segmentsToTest[] = ['pageTitle=^Profile pa', '_SegmentPageTitleStartsWith', ['Actions.getPageTitles']]; // ends with - $segmentsToTest[] = ['pageUrl=$er/profile', '_SegmentPageUrlEndsWith', ['Actions.getPageUrls']]; + $segmentsToTest[] = ['pageUrl=$er/profile', '_SegmentPageUrlEndsWith' . ($olderThanMatomo5110b1 ? '_old' : ''), ['Actions.getPageUrls']]; $segmentsToTest[] = ['pageTitle=$page', '_SegmentPageTitleEndsWith', ['Actions.getPageTitles']]; } From a3335f150d594ce027a194c9368cc7f775189513 Mon Sep 17 00:00:00 2001 From: Lachlan Reynolds Date: Wed, 3 Jun 2026 10:57:52 +1200 Subject: [PATCH 3/3] Added old tests [no_release] --- ...eContains_old__Actions.getPageUrls_day.xml | 113 +++++++++++++++++ ...lContains_old__Actions.getPageUrls_day.xml | 113 +++++++++++++++++ ...lEndsWith_old__Actions.getPageUrls_day.xml | 113 +++++++++++++++++ ...tartsWith_old__Actions.getPageUrls_day.xml | 115 ++++++++++++++++++ 4 files changed, 454 insertions(+) create mode 100644 tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains_old__Actions.getPageUrls_day.xml create mode 100644 tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains_old__Actions.getPageUrls_day.xml create mode 100644 tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlEndsWith_old__Actions.getPageUrls_day.xml create mode 100644 tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlStartsWith_old__Actions.getPageUrls_day.xml diff --git a/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains_old__Actions.getPageUrls_day.xml b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains_old__Actions.getPageUrls_day.xml new file mode 100644 index 0000000..2dae6b2 --- /dev/null +++ b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains_old__Actions.getPageUrls_day.xml @@ -0,0 +1,113 @@ + + + + + 1 + 1 + 1 + 360 + 0 + 0 + + + 1 + 1 + 3 + 364 + 0 + + + 1 + 0 + 3 + 0.3333 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + + + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + + + 0 + 0 + 360 + 0% + 0% + http://example.org/homepage + pageUrl==http%253A%252F%252Fexample.org%252Fhomepage + + + + 1 + 2 + 0 + 0 + 0 + + + 1 + + + 2 + 0 + 3 + 0.6666 + 1 + 2 + 0 + + + 0 + 0 + 0 + 0% + 100% + pageUrl=^http%253A%252F%252Fpiwik.net%252Fuser + + + + 1 + 1 + 2 + 0 + 0 + 0 + + + 1 + 1 + + + 2 + 0 + 3 + 0.6666 + 0 + 2 + 0 + + + 0 + 0% + 100% + http://example.org/user/profile + pageUrl==http%253A%252F%252Fexample.org%252Fuser%252Fprofile + + + + \ No newline at end of file diff --git a/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains_old__Actions.getPageUrls_day.xml b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains_old__Actions.getPageUrls_day.xml new file mode 100644 index 0000000..2dae6b2 --- /dev/null +++ b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains_old__Actions.getPageUrls_day.xml @@ -0,0 +1,113 @@ + + + + + 1 + 1 + 1 + 360 + 0 + 0 + + + 1 + 1 + 3 + 364 + 0 + + + 1 + 0 + 3 + 0.3333 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + + + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + + + 0 + 0 + 360 + 0% + 0% + http://example.org/homepage + pageUrl==http%253A%252F%252Fexample.org%252Fhomepage + + + + 1 + 2 + 0 + 0 + 0 + + + 1 + + + 2 + 0 + 3 + 0.6666 + 1 + 2 + 0 + + + 0 + 0 + 0 + 0% + 100% + pageUrl=^http%253A%252F%252Fpiwik.net%252Fuser + + + + 1 + 1 + 2 + 0 + 0 + 0 + + + 1 + 1 + + + 2 + 0 + 3 + 0.6666 + 0 + 2 + 0 + + + 0 + 0% + 100% + http://example.org/user/profile + pageUrl==http%253A%252F%252Fexample.org%252Fuser%252Fprofile + + + + \ No newline at end of file diff --git a/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlEndsWith_old__Actions.getPageUrls_day.xml b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlEndsWith_old__Actions.getPageUrls_day.xml new file mode 100644 index 0000000..2dae6b2 --- /dev/null +++ b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlEndsWith_old__Actions.getPageUrls_day.xml @@ -0,0 +1,113 @@ + + + + + 1 + 1 + 1 + 360 + 0 + 0 + + + 1 + 1 + 3 + 364 + 0 + + + 1 + 0 + 3 + 0.3333 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + + + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + + + 0 + 0 + 360 + 0% + 0% + http://example.org/homepage + pageUrl==http%253A%252F%252Fexample.org%252Fhomepage + + + + 1 + 2 + 0 + 0 + 0 + + + 1 + + + 2 + 0 + 3 + 0.6666 + 1 + 2 + 0 + + + 0 + 0 + 0 + 0% + 100% + pageUrl=^http%253A%252F%252Fpiwik.net%252Fuser + + + + 1 + 1 + 2 + 0 + 0 + 0 + + + 1 + 1 + + + 2 + 0 + 3 + 0.6666 + 0 + 2 + 0 + + + 0 + 0% + 100% + http://example.org/user/profile + pageUrl==http%253A%252F%252Fexample.org%252Fuser%252Fprofile + + + + \ No newline at end of file diff --git a/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlStartsWith_old__Actions.getPageUrls_day.xml b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlStartsWith_old__Actions.getPageUrls_day.xml new file mode 100644 index 0000000..f873185 --- /dev/null +++ b/tests/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlStartsWith_old__Actions.getPageUrls_day.xml @@ -0,0 +1,115 @@ + + + + + 2 + 2 + 2 + 360 + 0 + 0 + + + 2 + 2 + 4 + 725 + 1 + 1 + 1 + + + 1 + 0 + 3 + 0.3333 + 0.5 + 1 + 0 + 1000 + 1 + 500 + 2 + + + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0.5 + 0 + 1 + + + 0 + 0 + 180 + 50% + 50% + http://example.org/homepage + pageUrl==http%253A%252F%252Fexample.org%252Fhomepage + + + + 1 + 2 + 0 + 0 + 0 + + + 1 + + + 2 + 0 + 3 + 0.6666 + 1 + 2 + 0 + + + 0 + 0 + 0 + 0% + 100% + pageUrl=^http%253A%252F%252Fpiwik.net%252Fuser + + + + 1 + 1 + 2 + 0 + 0 + 0 + + + 1 + 1 + + + 2 + 0 + 3 + 0.6666 + 0 + 2 + 0 + + + 0 + 0% + 100% + http://example.org/user/profile + pageUrl==http%253A%252F%252Fexample.org%252Fuser%252Fprofile + + + + \ No newline at end of file