1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-25 14:10:44 +02:00

Added indexOf and indexOfLast

This commit is contained in:
Tadeu Bento
2015-04-09 23:15:13 +01:00
committed by Daniel St. Jules
parent 3cf18e9e42
commit 9a5601efef
6 changed files with 144 additions and 1 deletions

View File

@@ -153,6 +153,24 @@ class StringyTestCase extends CommonTest
unset($stringy[1]);
}
/**
* @dataProvider indexOfProvider()
*/
public function testIndexOf($expected, $str, $subStr, $offset = 0, $encoding = null)
{
$result = S::create($str, $encoding)->indexOf($subStr, $offset);
$this->assertEquals($expected, $result);
}
/**
* @dataProvider indexOfLastProvider()
*/
public function testIndexOfLast($expected, $str, $subStr, $offset = 0, $encoding = null)
{
$result = S::create($str, $encoding)->indexOfLast($subStr, $offset);
$this->assertEquals($expected, $result);
}
/**
* @dataProvider charsProvider()
*/
@@ -911,4 +929,5 @@ class StringyTestCase extends CommonTest
$this->assertEquals($expected, $result);
$this->assertEquals($str, $stringy);
}
}