~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

Viewing changes to ext/standard/tests/general_functions/escapeshellcmd-win32.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
ImportĀ upstreamĀ versionĀ 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Test escapeshellcmd() functionality on Windows
 
3
--SKIPIF--
 
4
<?php
 
5
if( substr(PHP_OS, 0, 3) != 'WIN' ) {
 
6
   die('skip...Valid for Windows only');
 
7
}
 
8
?>
 
9
--FILE--
 
10
<?php
 
11
echo "*** Testing escapeshellcmd() basic operations ***\n";
 
12
$data = array(
 
13
        '"abc',
 
14
        "'abc",
 
15
        '?<>',
 
16
        '()[]{}$',
 
17
        '%^',
 
18
        '#&;`|*?',
 
19
        '~<>\\',
 
20
        '%NOENV%'
 
21
);
 
22
 
 
23
$count = 1;
 
24
foreach ($data AS $value) {
 
25
        echo "-- Test " . $count++ . " --\n";
 
26
        var_dump(escapeshellcmd($value));
 
27
}
 
28
 
 
29
echo "Done\n";
 
30
?>
 
31
--EXPECTF--
 
32
*** Testing escapeshellcmd() basic operations ***
 
33
-- Test 1 --
 
34
string(5) "^"abc"
 
35
-- Test 2 --
 
36
string(5) "^'abc"
 
37
-- Test 3 --
 
38
string(6) "^?^<^>"
 
39
-- Test 4 --
 
40
string(14) "^(^)^[^]^{^}^$"
 
41
-- Test 5 --
 
42
string(4) "^%^^"
 
43
-- Test 6 --
 
44
string(14) "^#^&^;^`^|^*^?"
 
45
-- Test 7 --
 
46
string(8) "^~^<^>^\"
 
47
-- Test 8 --
 
48
string(9) "^%NOENV^%"
 
49
Done