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 'tests/PHPUnit/Integration/OptionTest.php')
-rw-r--r--tests/PHPUnit/Integration/OptionTest.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/OptionTest.php b/tests/PHPUnit/Integration/OptionTest.php
index 5632867178..b65610a5d7 100644
--- a/tests/PHPUnit/Integration/OptionTest.php
+++ b/tests/PHPUnit/Integration/OptionTest.php
@@ -175,4 +175,37 @@ class OptionTest extends IntegrationTestCase
Option::deleteLike("%\\_defaultReport");
$this->assertSame('0', Option::get('adefaultReport'));
}
+
+ public function testDeleteLike_underscoreNotWildcard()
+ {
+ // insert guard - to test unescaped underscore
+ Option::set('adefaultReport', '1', true);
+
+ Option::deleteLike("adefaul_Report"); // the underscore should not match a character
+ $this->assertSame('1', Option::get('adefaultReport'));
+ }
+
+ public function testGetLike()
+ {
+ Option::set('adefaultReport', '1', true);
+ Option::set('adefaultRepo', '1', true);
+ Option::set('adefaultRepppppppport', '1', true);
+
+ $values = Option::getLike("adefaultRepo%"); // the underscore should not match a character
+ $this->assertSame(array(
+ 'adefaultRepo' => '1',
+ 'adefaultReport' => '1'
+ ), $values);
+ }
+
+ public function testGetLike_underscoreNotWildcard()
+ {
+ // insert guard - to test unescaped underscore
+ Option::set('adefaultReport', '1', true);
+
+ $values = Option::getLike("adefaul_Report"); // the underscore should not match a character
+ $this->assertSame(array(), $values);
+ $values = Option::getLike("adefaul%Report");
+ $this->assertSame(array('adefaultReport' => '1'), $values);
+ }
}