Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/libraries/PMA_StringNative_test.php')
-rw-r--r--test/libraries/PMA_StringNative_test.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/libraries/PMA_StringNative_test.php b/test/libraries/PMA_StringNative_test.php
index 170eb81474..c3543248d1 100644
--- a/test/libraries/PMA_StringNative_test.php
+++ b/test/libraries/PMA_StringNative_test.php
@@ -159,5 +159,53 @@ class PMA_StringNative_Test extends PHPUnit_Framework_TestCase
array("test string", "TEST STRING")
);
}
+
+ /**
+ * Test for PMA_StringNative::strrchr
+ *
+ * @param string $expected Expected substring
+ * @param string $haystack String to cut
+ * @param string $needle Searched string
+ *
+ * @return void
+ * @test
+ * @dataProvider providerStrrchr
+ */
+ public function testStrrchr($expected, $haystack, $needle)
+ {
+ $this->assertEquals(
+ $expected,
+ $this->testObject->strrchr($haystack, $needle)
+ );
+ }
+
+ /**
+ * Data provider for testStrrchr
+ *
+ * @return array Test data
+ */
+ public function providerStrrchr()
+ {
+ return array(
+ array('abcdef', 'abcdefabcdef', 'a'),
+ array(false, 'abcdefabcdef', 'A'),
+ array('f', 'abcdefabcdef', 'f'),
+ array(false, 'abcdefabcdef', 'z'),
+ array(false, 'abcdefabcdef', ''),
+ array(false, 'abcdefabcdef', false),
+ array(false, 'abcdefabcdef', true),
+ array(false, '789456123', true),
+ array(false, 'abcdefabcdef', null),
+ array(false, null, null),
+ array(false, null, 'a'),
+ array(false, null, '0'),
+ array(false, false, null),
+ array(false, false, 'a'),
+ array(false, false, '0'),
+ array(false, true, null),
+ array(false, true, 'a'),
+ array(false, true, '0'),
+ );
+ }
}
?>