Annotation of embedaddon/php/ext/standard/tests/strings/php_strip_whitespace.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: php_strip_whitespace() tests
! 3: --FILE--
! 4: <?php
! 5:
! 6: $filename = dirname(__FILE__)."/php_strip_whitespace.dat";
! 7:
! 8: var_dump(php_strip_whitespace());
! 9: var_dump(php_strip_whitespace($filename));
! 10:
! 11: $data = '/* test comment */';
! 12: file_put_contents($filename, $data);
! 13: var_dump(php_strip_whitespace($filename));
! 14:
! 15: $data = '<?php /* test comment */ ?>';
! 16: file_put_contents($filename, $data);
! 17: var_dump(php_strip_whitespace($filename));
! 18:
! 19: $data = '<?php
! 20: /* test class */
! 21: class test {
! 22:
! 23: /* function foo () */
! 24:
! 25: function foo () /* {{{ */
! 26: {
! 27:
! 28:
! 29: echo $var; //does not exist
! 30: }
! 31: /* }}} */
! 32:
! 33: }
! 34: ?>';
! 35:
! 36: file_put_contents($filename, $data);
! 37: var_dump(php_strip_whitespace($filename));
! 38:
! 39: @unlink($filename);
! 40: echo "Done\n";
! 41: ?>
! 42: --EXPECTF--
! 43: Warning: php_strip_whitespace() expects exactly 1 parameter, 0 given in %s on line %d
! 44: bool(false)
! 45:
! 46: Warning: php_strip_whitespace(%sphp_strip_whitespace.dat): failed to open stream: No such file or directory in %s on line %d
! 47: string(0) ""
! 48: string(18) "/* test comment */"
! 49: string(9) "<?php ?>"
! 50: string(55) "<?php
! 51: class test { function foo () { echo $var; } } ?>"
! 52: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>