mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-11 15:54:04 +02:00
Added isBase64 method
This commit is contained in:
committed by
Daniel St. Jules
parent
f086c67ac7
commit
318db789b1
@@ -2170,6 +2170,31 @@ class StringyTestCase extends PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider isBase64Provider()
|
||||
*/
|
||||
public function testIsBase64($expected, $str)
|
||||
{
|
||||
$stringy = S::create($str);
|
||||
$result = $stringy->isBase64();
|
||||
$this->assertInternalType('boolean', $result);
|
||||
$this->assertEquals($expected, $result);
|
||||
$this->assertEquals($str, $stringy);
|
||||
}
|
||||
|
||||
public function isBase64Provider()
|
||||
{
|
||||
return array(
|
||||
array(false, ' '),
|
||||
array(false, ''),
|
||||
array(true, base64_encode('FooBar') ),
|
||||
array(true, base64_encode(' ') ),
|
||||
array(true, base64_encode('FÒÔBÀŘ') ),
|
||||
array(true, base64_encode('συγγραφέας') ),
|
||||
array(false, 'Foobar'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider isUpperCaseProvider()
|
||||
*/
|
||||
|
Reference in New Issue
Block a user