X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FUtilsTest.php;h=c885f552350b62cf003921c5b36673b3224eea14;hb=b3051a6aae446e063c3b6fa4a6a600357a9f24af;hp=0cf9a921ed0ee979da42d0ec3d5846e822c919f7;hpb=e0177549c760b143efdd17b1579e0c0199dce939;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php index 0cf9a921..c885f552 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -253,7 +253,7 @@ class UtilsTest extends PHPUnit_Framework_TestCase is_session_id_valid('c0ZqcWF3VFE2NmJBdm1HMVQ0ZHJ3UmZPbTFsNGhkNHI=') ); } - + /** * Test generateSecretApi. */ @@ -270,4 +270,16 @@ class UtilsTest extends PHPUnit_Framework_TestCase $this->assertFalse(generate_api_secret('', '')); $this->assertFalse(generate_api_secret(false, false)); } + + /** + * Test normalize_spaces. + */ + public function testNormalizeSpace() + { + $str = ' foo bar is important '; + $this->assertEquals('foo bar is important', normalize_spaces($str)); + $this->assertEquals('foo', normalize_spaces('foo')); + $this->assertEquals('', normalize_spaces('')); + $this->assertEquals(null, normalize_spaces(null)); + } }