Make WordPress Core

Ticket #14401: 14401.unit-tests.diff

File 14401.unit-tests.diff, 1.2 KB (added by dd32, 10 years ago)
  • tests/tests/filesystem/find_folder.php

     
    104104                $this->assertEquals( '/example.com/sub/wp-content/plugins/', $path );
    105105        }
    106106
     107        /**
     108         * Server Configuration where the web servers local paths do not match the FTP servers paths
     109         *
     110         * In this case, ftp: /home/www/example.com/ ~= web: /srv2/www/example.com/
     111         *
     112         * @ticket 14401
     113         */
     114        function test_server_basepath_mismatches() {
     115                global $wp_filesystem;
     116                $fs = $wp_filesystem;
     117                $fs->init('
     118                        /home/www/example.com/subdomains/www/index.php
     119                        /home/www/example.com/subdomains/www/wp-includes/
     120                        /home/www/example.com/subdomains/www/wp-content/plugins/
     121                ');
     122
     123                $path = $fs->abspath( '/srv2/www/example.com/subdomains/www/' );
     124                $this->assertEquals( '/home/www/example.com/subdomains/www/', $path );
     125
     126                $path = $fs->find_folder( '/srv2/www/example.com/subdomains/www/wp-content/plugins/' );
     127                $this->assertEquals( '/home/www/example.com/subdomains/www/wp-content/plugins/', $path );
     128
     129        }
     130
    107131}
     132 No newline at end of file