3 class common_blank_test
extends DokuWikiTest
{
7 function test_blank() {
10 array('string', false),
14 array(array('something'), false),
16 // these aren't either!
33 foreach($tests as $test) {
34 $this->assertEquals($test[1], blank($test[0]), "using " . var_export($test[0], true));
38 function test_trim() {
39 $whitespace = " \t\r\n";
40 $this->assertFalse(blank($whitespace), "using default \$trim value");
41 $this->assertFalse(blank($whitespace, false), "using \$trim = false");
42 $this->assertTrue(blank($whitespace, true), "using \$trim = true");
45 function test_undefined() {
47 $this->assertTrue(blank($var), "using undefined/unitialised variable");
48 $this->assertTrue(blank($undef['nope']), "using undefined array index");
49 $this->assertTrue(blank($this->nope
), "using unset object property");