Annotation of embedaddon/php/sapi/cgi/tests/003.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: strip comments and whitespace with -w
        !             3: --SKIPIF--
        !             4: <?php 
        !             5: include "skipif.inc"; 
        !             6: ?>
        !             7: --FILE--
        !             8: <?php
        !             9: 
        !            10: include "include.inc";
        !            11: 
        !            12: $php = get_cgi_path();
        !            13: reset_env_vars();
        !            14: 
        !            15: $filename = dirname(__FILE__).'/003.test.php';
        !            16: $code ='
        !            17: <?php
        !            18: /* some test script */
        !            19: 
        !            20: class test { /* {{{ */
        !            21:        public $var = "test"; //test var
        !            22: #perl style comment 
        !            23:        private $pri; /* private attr */
        !            24: 
        !            25:        function foo(/* void */) {
        !            26:        }
        !            27: }
        !            28: /* }}} */
        !            29: 
        !            30: ?>
        !            31: ';
        !            32: 
        !            33: file_put_contents($filename, $code);
        !            34: 
        !            35: var_dump(`$php -n -w "$filename"`);
        !            36: var_dump(`$php -n -w "wrong"`);
        !            37: var_dump(`echo "<?php /* comment */ class test {\n // comment \n function foo() {} } ?>" | $php -n -w`);
        !            38: 
        !            39: @unlink($filename);
        !            40: 
        !            41: echo "Done\n";
        !            42: ?>
        !            43: --EXPECTF--    
        !            44: string(%d) "X-Powered-By: PHP/%s
        !            45: Content-type: text/html%r; charset=.*|%r
        !            46: 
        !            47: 
        !            48: <?php
        !            49:  class test { public $var = "test"; private $pri; function foo() { } } ?>
        !            50: "
        !            51: string(%d) "Status: 404 Not Found
        !            52: X-Powered-By: PHP/%s
        !            53: Content-type: text/html%r; charset=.*|%r
        !            54: 
        !            55: No input file specified.
        !            56: "
        !            57: string(%d) "X-Powered-By: PHP/%s
        !            58: Content-type: text/html%r; charset=.*|%r
        !            59: 
        !            60: <?php  class test { function foo() {} } ?>
        !            61: "
        !            62: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>