~ubuntu-branches/ubuntu/lucid/php5/lucid

« back to all changes in this revision

Viewing changes to ext/standard/tests/file/windows_links/bug48746_2.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-03-16 09:09:50 UTC
  • mfrom: (1.1.18 upstream) (0.3.10 sid)
  • Revision ID: james.westby@ubuntu.com-20100316090950-e36m0pzranoixifd
Tags: 5.3.2-1ubuntu1
* Merge from debian unstable: 
  - debian/control:
    * Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    * Dropped libmysqlclient15-dev, build against mysql 5.1.
    * Dropped libcurl-dev not in the archive.
    * Suggest php5-suhosin rather than recommends.
    * Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions already in
      universe.
    * Dropped libonig-dev and libqgdbm since its in universe. (will be re-added in lucid+1)
    * Dropped locales-all.
  - modulelist: Drop imap, interbase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
  - Dropped debian/patches/libedit_is_editline.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Bug#48746 - Junction not working properly
 
3
 
 
4
--CREDIT--
 
5
Venkat Raman Don (don.raman@microsoft.com)
 
6
 
 
7
--SKIPIF--
 
8
<?php
 
9
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
 
10
    die('skip windows only test');
 
11
}
 
12
$ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out);
 
13
if (strpos($ret, 'privilege')) {
 
14
        die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');
 
15
}
 
16
unlink('mklink bug48746_tmp.lnk');
 
17
?>
 
18
--FILE--
 
19
<?php
 
20
$old_dir = __DIR__;
 
21
$dirname = __DIR__ . "\\mnt\\test\\directory";
 
22
exec("mkdir " . $dirname, $output, $ret_val);
 
23
chdir(__DIR__ . "\\mnt\\test");
 
24
$drive = substr(__DIR__, 0, 2);
 
25
$pathwithoutdrive = substr(__DIR__, 2);
 
26
$ret = exec("mountvol " . $drive . " /L", $output, $ret_val);
 
27
exec("mklink /j mounted_volume " . $ret, $output, $ret_val);
 
28
$fullpath = "mounted_volume" . $pathwithoutdrive;
 
29
exec("mklink /j mklink_junction directory", $output, $ret_val);
 
30
file_put_contents("mklink_junction\\a.php", "<?php echo \"I am included.\n\" ?>");
 
31
file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", "<?php echo \"I am included.\n\" ?>");
 
32
print_r(scandir("mklink_junction"));
 
33
print_r(scandir("$fullpath\\mnt\\test\\directory"));
 
34
print_r(scandir("$fullpath\\mnt\\test\\mklink_junction"));
 
35
unlink("$fullpath\\mnt\\test\\directory\\b.php");
 
36
unlink("mklink_junction\\a.php");
 
37
chdir($old_dir);
 
38
rmdir(__DIR__ . "\\mnt\\test\\directory");
 
39
rmdir(__DIR__ . "\\mnt\\test\\mklink_junction");
 
40
rmdir(__DIR__ . "\\mnt\\test\\mounted_volume");
 
41
rmdir(__DIR__ . "\\mnt\\test");
 
42
rmdir(__DIR__ . "\\mnt");
 
43
 
 
44
?>
 
45
--EXPECT--
 
46
Array
 
47
(
 
48
    [0] => .
 
49
    [1] => ..
 
50
    [2] => a.php
 
51
    [3] => b.php
 
52
)
 
53
Array
 
54
(
 
55
    [0] => .
 
56
    [1] => ..
 
57
    [2] => a.php
 
58
    [3] => b.php
 
59
)
 
60
Array
 
61
(
 
62
    [0] => .
 
63
    [1] => ..
 
64
    [2] => a.php
 
65
    [3] => b.php
 
66
)