Skip to content

Commit

Permalink
tests fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zenovich committed May 19, 2013
1 parent 453cbb4 commit bb22dc0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions tests/Runkit_Sandbox.open_basedir.phpt
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
--TEST--
Runkit_Sandbox - Prevent overriding open_basedir when a bogus path is present
--SKIPIF--
<?php if(!extension_loaded("runkit") || !RUNKIT_FEATURE_SANDBOX) print "skip"; ?>
--INI--
open_basedir="/bogus-does-not-exist-runkit-test-dir"
--FILE--
<?php
ini_set('open_basedir', '/bogus-does-not-exist-runkit-test-dir');
//ini_set('open_basedir', '/bogus-does-not-exist-runkit-test-dir');
var_dump(ini_get('open_basedir'));

$s = new Runkit_Sandbox(array(
'open_basedir' => __DIR__,
'open_basedir' => dirname(__FILE__),
));

var_dump(__DIR__ === $s->ini_get('open_basedir'));
var_dump(dirname(__FILE__) === $s->ini_get('open_basedir'));

--EXPECT--
string(37) "/bogus-does-not-exist-runkit-test-dir"
Expand Down
10 changes: 7 additions & 3 deletions tests/bug64496.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
--TEST--
Bug #64496 - Runkit_Sandbox override of open_basedir when parent uses multiple paths
--SKIPIF--
<?php if(!extension_loaded("runkit") || !RUNKIT_FEATURE_SANDBOX) print "skip";
if(version_compare(PHP_VERSION, '5.3.0', '<')) print "skip";
?>
--FILE--
<?php
$tmp = realpath(sys_get_temp_dir());
$dir = realpath(__DIR__);
$parent = realpath(dirname(dirname(__DIR__)));
ini_set('open_basedir', sys_get_temp_dir() . ':' . dirname(__DIR__));
$dir = realpath(dirname(__FILE__));
$parent = realpath(dirname(dirname(dirname(__FILE__))));
ini_set('open_basedir', sys_get_temp_dir() . ':' . dirname(dirname(__FILE__)));

foreach(array(
"$tmp:$dir",
Expand Down

0 comments on commit bb22dc0

Please sign in to comment.