Annotation of embedaddon/php/ext/standard/tests/file/windows_acls/bug44859.phpt, revision 1.1

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

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