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:
committed by
Daniel St. Jules
parent
3cf18e9e42
commit
9a5601efef
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user