2014-08-26 21:02:40 +04:00
< ? php
/**
* Copyright ( c ) 2014 Lukas Reschke < lukas @ owncloud . com >
* This file is licensed under the Affero General Public License version 3 or
* later .
* See the COPYING - README file .
*/
use \OC\Security\StringUtils ;
2014-11-11 01:30:38 +03:00
class StringUtilsTest extends \Test\TestCase {
2014-08-26 21:02:40 +04:00
2014-09-03 15:51:44 +04:00
public function dataProvider ()
{
return array (
array ( 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.' , 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.' ),
array ( '' , '' ),
array ( '我看这本书。 我看這本書' , '我看这本书。 我看這本書' ),
array ( 'GpKY9fSnWNJbES99zVGvA' , 'GpKY9fSnWNJbES99zVGvA' )
);
}
/**
* @ dataProvider dataProvider
*/
function testWrongEquals ( $string ) {
$this -> assertFalse ( StringUtils :: equals ( $string , 'A Completely Wrong String' ));
$this -> assertFalse ( StringUtils :: equals ( $string , null ));
}
/**
* @ dataProvider dataProvider
*/
function testTrueEquals ( $string , $expected ) {
$this -> assertTrue ( StringUtils :: equals ( $string , $expected ));
2014-08-26 21:02:40 +04:00
}
}