diff options
author | sgiehl <stefan@matomo.org> | 2020-07-24 14:11:05 +0300 |
---|---|---|
committer | sgiehl <stefan@matomo.org> | 2020-07-24 15:28:48 +0300 |
commit | 679e73f1236969db0c2d767655cb84456a727d24 (patch) | |
tree | 648722fa79cb524f8819857e79163e0c1cf16d59 /tests/PHPUnit/Integration/OptionTest.php | |
parent | 6b5f8138180716d5088d764f0b41d5787159b28a (diff) | |
parent | 3e1234a887f56a1cf853e29ba89370b234af5127 (diff) |
Merge branch '3.x-dev' into 4.x-dev
Diffstat (limited to 'tests/PHPUnit/Integration/OptionTest.php')
-rw-r--r-- | tests/PHPUnit/Integration/OptionTest.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/OptionTest.php b/tests/PHPUnit/Integration/OptionTest.php index b487f4f939..dfc279d7ba 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); + } } |