1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-16 02:04:09 +02:00

Remove __callStatic, stop throwing exception if argument 0 isn't a string (no scalar type hinting, so we'll allow type juggling)

This commit is contained in:
Daniel St. Jules
2013-07-14 21:21:22 -04:00
parent 38dc44ddc8
commit ace2dee61b
4 changed files with 82 additions and 112 deletions

View File

@@ -7,20 +7,6 @@ use Stringy\Stringy as S;
class StringyTestCase extends PHPUnit_Framework_TestCase {
/**
* @expectedException BadMethodCallException
*/
public function testExceptionOnUndefinedMethod() {
S::doesntExist('test', 'UTF-8');
}
/**
* @expectedException InvalidArgumentException
*/
public function testExceptionWithInvalidArgument() {
S::camelize(1, 'UTF-8');
}
/**
* @dataProvider stringsForUpperCaseFirst
*/
@@ -199,8 +185,8 @@ class StringyTestCase extends PHPUnit_Framework_TestCase {
/**
* @dataProvider stringsForTitleize
*/
public function testTitleize($string, $expected, $encoding = null, $ignore = null) {
$result = S::titleize($string, $encoding, $ignore);
public function testTitleize($string, $expected, $ignore = null, $encoding = null) {
$result = S::titleize($string, $ignore, $encoding);
$this->assertEquals($expected, $result);
}
@@ -209,10 +195,10 @@ class StringyTestCase extends PHPUnit_Framework_TestCase {
$testData = array(
array('testing the method', 'Testing The Method'),
array('testing the method', 'Testing the Method', 'UTF-8', $ignore),
array('testing the method', 'Testing the Method', $ignore, 'UTF-8'),
array('i like to watch DVDs at home', 'I Like to Watch DVDs at Home',
'UTF-8', $ignore),
array(' Θα ήθελα να φύγει ', 'Θα Ήθελα Να Φύγει', 'UTF-8')
$ignore, 'UTF-8'),
array(' Θα ήθελα να φύγει ', 'Θα Ήθελα Να Φύγει', null, 'UTF-8')
);
return $testData;