source: branches/version-2_5-dev/data/module/Compat/tests/function/php_strip_whitespace.phpt @ 20116

Revision 20116, 803 bytes checked in by nanasess, 13 years ago (diff)
  • svn properties を再設定
  • 再設定用のスクリプト追加
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
Line 
1--TEST--
2Function -- php_strip_whitespace
3--SKIPIF--
4<?php
5if (function_exists('php_strip_whitespace') ||
6    !extension_loaded('tokenizer')) {
7       
8    echo 'skip';
9}
10?>
11--FILE--
12<?php
13require_once 'PHP/Compat.php';
14PHP_Compat::loadFunction('php_strip_whitespace');
15
16// Here is some sample PHP code to write to the file
17$string = '<?php
18// PHP comment here
19
20/*
21 * Another PHP comment
22 */
23
24echo        php_strip_whitespace($_SERVER[\'PHP_SELF\']);
25// Newlines are considered whitespace, and are removed too:
26do_nothing();
27?>';
28
29// Create a temp file
30$tmpfname = tempnam('/tmp', 'phpcompat');
31$fh = fopen($tmpfname, 'w');
32fwrite($fh, $string);
33
34// Test
35echo php_strip_whitespace($tmpfname);
36
37// Close
38fclose($fh);
39?>
40--EXPECT--
41<?php
42 echo php_strip_whitespace($_SERVER['PHP_SELF']); do_nothing(); ?>
Note: See TracBrowser for help on using the repository browser.