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:
Diffstat (limited to 'plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php')
-rw-r--r--plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php24
1 files changed, 14 insertions, 10 deletions
diff --git a/plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php b/plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php
index 07e2152739..95ed3c12bb 100644
--- a/plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php
+++ b/plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php
@@ -8,6 +8,7 @@
namespace Piwik\Plugins\SegmentEditor\tests\Integration;
+use Piwik\ArchiveProcessor\Rules;
use Piwik\Date;
use Piwik\Piwik;
use Piwik\Plugins\SegmentEditor\API;
@@ -47,16 +48,13 @@ class SegmentEditorTest extends IntegrationTestCase
*/
public function testAddInvalidSegment_ShouldThrow()
{
- try {
- API::getInstance()->add('name', 'test==test2');
- $this->fail("Exception not raised.");
- } catch (Exception $expected) {
- }
- try {
- API::getInstance()->add('name', 'test');
- $this->fail("Exception not raised.");
- } catch (Exception $expected) {
- }
+ $this->expectException(\Exception::class);
+
+ API::getInstance()->add('name', 'test==test2');
+ $this->fail("Exception not raised.");
+
+ API::getInstance()->add('name', 'test');
+ $this->fail("Exception not raised.");
}
/**
@@ -90,6 +88,8 @@ class SegmentEditorTest extends IntegrationTestCase
*/
public function test_AddAndGet_AnotherSegment()
{
+ Rules::setBrowserTriggerArchiving(false);
+
$name = 'name';
$definition = 'searches>1,visitIp!=127.0.0.1';
$idSegment = API::getInstance()->add($name, $definition, $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);
@@ -135,6 +135,8 @@ class SegmentEditorTest extends IntegrationTestCase
*/
public function test_UpdateSegment()
{
+ Rules::setBrowserTriggerArchiving(false);
+
$name = 'name"';
$definition = 'searches>1,visitIp!=127.0.0.1';
$nameSegment1 = 'hello';
@@ -179,6 +181,8 @@ class SegmentEditorTest extends IntegrationTestCase
*/
public function test_deleteSegment()
{
+ Rules::setBrowserTriggerArchiving(false);
+
$idSegment1 = API::getInstance()->add('name 1', 'searches==0', $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);
$idSegment2 = API::getInstance()->add('name 2', 'searches>1,visitIp!=127.0.0.1', $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);