Annotation of embedaddon/php/ext/standard/tests/file/windows_acls/bug44859_4.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: bug #44859 (incorrect result with NTFS ACL permissions, is_readable)
                      3: --CREDITS--
                      4: Venkat Raman Don
                      5: --SKIPIF--
                      6: <?php 
                      7: include_once __DIR__ . '/common.inc';
                      8: skipif();
                      9: ?>
                     10: --FILE--
                     11: <?php
                     12: include_once __DIR__ . '/common.inc';
                     13: 
                     14: $iteration = array(
                     15:        PHPT_ACL_READ => true,
                     16:        PHPT_ACL_NONE => false,
                     17:        PHPT_ACL_WRITE => false,
                     18:        PHPT_ACL_WRITE|PHPT_ACL_READ => true,
                     19: );
                     20: 
                     21: echo "Testing file with relative path:\n";
                     22: $i = 1;
                     23: $path = './a.txt';
                     24: foreach ($iteration as $perms => $exp) {
                     25:        create_file($path, $perms);
                     26:        clearstatcache(true, $path);
                     27:        echo 'Iteration #' . $i++ . ': ';
                     28:        if (is_readable($path) == $exp) {
                     29:                echo "passed.\n";
                     30:        } else {
                     31:                var_dump(is_readable($path), $exp);
                     32:                echo "failed.\n";
                     33:        }
                     34:        delete_file($path);
                     35: }
                     36: 
                     37: echo "Testing directory with relative path:\n";
                     38: $path = 'adir';
                     39: $i = 1;
                     40: foreach ($iteration as $perms => $exp) {
                     41:        create_file($path, $perms);
                     42:        clearstatcache(true, $path);
                     43:        echo 'Iteration #' . $i++ . ': ';
                     44:        if (is_readable($path) == $exp) {
                     45:                echo "passed.\n";
                     46:        } else {
                     47:                var_dump(is_readable($path), $exp);
                     48:                echo "failed.\n";
                     49:        }
                     50:        delete_file($path);
                     51: }
                     52: 
                     53: ?>
                     54: --EXPECT--
                     55: Testing file with relative path:
                     56: Iteration #1: passed.
                     57: Iteration #2: passed.
                     58: Iteration #3: passed.
                     59: Iteration #4: passed.
                     60: Testing directory with relative path:
                     61: Iteration #1: passed.
                     62: Iteration #2: passed.
                     63: Iteration #3: passed.
                     64: Iteration #4: passed.

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