Skip to content

Commit 3445994

Browse files
committed
- Finished first stage of tests cleanup, now all test use the same directory
1 parent 75ceb2c commit 3445994

File tree

154 files changed

+314
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+314
-448
lines changed

tests/Registry/AllRegistries/Registry/detectFileConflicts/detectfileconflicts.basic.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ Registry: test detectFileConflicts
33
--FILE--
44
<?php
55
require __DIR__ . '/../setup.php.inc';
6-
$dir = __DIR__ . DIRECTORY_SEPARATOR . 'testit' . DIRECTORY_SEPARATOR;
6+
$dir = TESTDIR . DIRECTORY_SEPARATOR;
77
require __DIR__ . '/../../detectfileconflicts/basic.template';
88

99
?>
1010
===DONE===
1111
--CLEAN--
1212
<?php
13-
$dir = dirname(__DIR__) . '/testit';
1413
include __DIR__ . '/../../../../clean.php.inc';
1514
?>
1615
--EXPECT--

tests/Registry/AllRegistries/Registry/getDependentPackages/getdependentpackages.basic.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ Registry: test getDependentPackages
33
--FILE--
44
<?php
55
require __DIR__ . '/../setup.php.inc';
6-
$dir = __DIR__ . DIRECTORY_SEPARATOR . 'testit' . DIRECTORY_SEPARATOR;
6+
$dir = TESTDIR . DIRECTORY_SEPARATOR;
77
require __DIR__ . '/../../getdependentpackages/basic.template';
88

99
?>
1010
===DONE===
1111
--CLEAN--
1212
<?php
13-
$dir = dirname(__DIR__) . '/testit';
1413
include __DIR__ . '/../../../../clean.php.inc';
1514
?>
1615
--EXPECT--

tests/Registry/AllRegistries/Registry/listPackages/cascade.phpt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Registry: test listPackages, cascading registries
33
--FILE--
44
<?php
55
require __DIR__ . '/../setup.cascade.php.inc';
6-
$dir = __DIR__ . DIRECTORY_SEPARATOR . 'testit' . DIRECTORY_SEPARATOR;
6+
$dir = TESTDIR . DIRECTORY_SEPARATOR . 'testit' . DIRECTORY_SEPARATOR;
77
$reg2->replace($info);
88
$packages = $reg->listPackages('pear2.php.net', false);
99
sort($packages);
@@ -16,9 +16,6 @@ $test->assertEquals(array(), $packages, 'test cascade onlyMain');
1616
===DONE===
1717
--CLEAN--
1818
<?php
19-
$dir = dirname(__DIR__) . '/testit';
20-
include __DIR__ . '/../../../../clean.php.inc';
21-
$dir = dirname(__DIR__) . '/testit2';
2219
include __DIR__ . '/../../../../clean.php.inc';
2320
?>
2421
--EXPECT--

tests/Registry/AllRegistries/Registry/listPackages/listpackages.multiple.channels.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Registry: test listPackages, multiple packages, multiple channels
33
--FILE--
44
<?php
55
require __DIR__ . '/../setup.php.inc';
6-
$dir = __DIR__ . DIRECTORY_SEPARATOR . 'testit' . DIRECTORY_SEPARATOR;
6+
$dir = TESTDIR . DIRECTORY_SEPARATOR;
77
require __DIR__ . '/../../listpackages/multiple.channels.template';
88
$packages = $reg->listPackages('pear2.php.net', true);
99
sort($packages);
@@ -13,7 +13,6 @@ $test->assertEquals(array('HooHa', 'HooHa2', 'PEAR2_SimpleChannelServer'), $pack
1313
===DONE===
1414
--CLEAN--
1515
<?php
16-
$dir = dirname(__DIR__) . '/testit';
1716
include __DIR__ . '/../../../../clean.php.inc';
1817
?>
1918
--EXPECT--
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22
require __DIR__ . '/../../setup.php.inc';
3-
@mkdir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testit');
4-
@mkdir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testit2');
5-
$reg2 = new \PEAR2\Pyrus\Registry(__DIR__.'/testit2');
6-
set_include_path(__DIR__ . DIRECTORY_SEPARATOR . 'testit' . PATH_SEPARATOR .
3+
@mkdir(TESTDIR . DIRECTORY_SEPARATOR . 'testit');
4+
@mkdir(TESTDIR . DIRECTORY_SEPARATOR . 'testit2');
5+
$reg2 = new \PEAR2\Pyrus\Registry(TESTDIR . '/testit2');
6+
set_include_path(TESTDIR . PATH_SEPARATOR .
77
__DIR__ . DIRECTORY_SEPARATOR . 'testit2');
8-
$c = \PEAR2\Pyrus\Config::singleton(__DIR__.'/testit', __DIR__. '/testit/plugins/notused.xml');
9-
$c->bin_dir = __DIR__ . '/testit/bin';
8+
$c = \PEAR2\Pyrus\Config::singleton(TESTDIR . '/testit', TESTDIR. '/testit/plugins/notused.xml');
9+
$c->bin_dir = TESTDIR . '/testit/bin';
1010
restore_include_path();
1111
$c->saveConfig();
1212
require __DIR__ . '/../../../PackageFile_v2/setupFiles/setupPackageFile.php.inc';
13-
$reg = new \PEAR2\Pyrus\Registry(__DIR__.'/testit');
13+
$reg = new \PEAR2\Pyrus\Registry(TESTDIR . '/testit');
1414
$reg->setParent($reg2);
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22
require __DIR__ . '/../../setup.php.inc';
3-
@mkdir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testit');
4-
set_include_path(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testit');
5-
$c = \PEAR2\Pyrus\Config::singleton(__DIR__.'/testit', __DIR__ . '/testit/plugins/pearconfig.xml');
6-
$c->bin_dir = __DIR__ . '/testit/bin';
3+
@mkdir(TESTDIR);
4+
set_include_path(TESTDIR);
5+
$c = \PEAR2\Pyrus\Config::singleton(TESTDIR, TESTDIR . '/plugins/pearconfig.xml');
6+
$c->bin_dir = TESTDIR . '/bin';
77
restore_include_path();
88
$c->saveConfig();
99
require __DIR__ . '/../../../PackageFile_v2/setupFiles/setupPackageFile.php.inc';
10-
$reg = new \PEAR2\Pyrus\Registry(__DIR__.'/testit');
10+
$reg = new \PEAR2\Pyrus\Registry(TESTDIR);

tests/Registry/AllRegistries/Registry/toPackageFile/cascade.phpt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Registry: test toPackageFile, cascading registries
33
--FILE--
44
<?php
55
require __DIR__ . '/../setup.cascade.php.inc';
6-
$dir = __DIR__ . DIRECTORY_SEPARATOR . 'testit' . DIRECTORY_SEPARATOR;
6+
$dir = TESTDIR . DIRECTORY_SEPARATOR . 'testit' . DIRECTORY_SEPARATOR;
77
$reg2->replace($info);
88

99
$package = $reg->toPackageFile('PEAR2_SimpleChannelServer', 'pear2.php.net');
@@ -12,9 +12,6 @@ $test->assertEquals('PEAR2_SimpleChannelServer', $package->name, 'ensure we got
1212
===DONE===
1313
--CLEAN--
1414
<?php
15-
$dir = dirname(__DIR__) . '/testit';
16-
include __DIR__ . '/../../../../clean.php.inc';
17-
$dir = dirname(__DIR__) . '/testit2';
1815
include __DIR__ . '/../../../../clean.php.inc';
1916
?>
2017
--EXPECT--

tests/Registry/AllRegistries/info/dirtree.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $result = $reg->info($info->name, $info->channel, 'dirtree');
99
if (substr(PHP_OS, 0, 3) == 'WIN') {
1010

1111
} else {
12-
// $dir must be set to __DIR__ . '/testit' in the test itself
12+
// $dir must be set to TESTDIR in the test itself
1313
$test->assertEquals(array (
1414
$dir . 'php/PEAR2/SimpleChannelServer/REST',
1515
$dir . 'php/PEAR2/SimpleChannelServer/Categories',

tests/Registry/AllRegistries/info/installedfiles.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ asort($result);
1010
if (substr(PHP_OS, 0, 3) == 'WIN') {
1111

1212
} else {
13-
// $dir must be set to __DIR__ . '/testit' in the test itself
13+
// $dir must be set to TESTDIR in the test itself
1414
$test->assertEquals(array (
1515
$dir . 'docs/PEAR2_SimpleChannelServer/pear2.php.net/examples/update_channel.php' =>
1616
array(

tests/Registry/Base/arrayaccess/arrayaccess.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Registry base: test ArrayAccess
33
--FILE--
44
<?php
55
require __DIR__ . '/setup.php.inc';
6-
$dir = __DIR__ . DIRECTORY_SEPARATOR . 'testit' . DIRECTORY_SEPARATOR;
6+
$dir = TESTDIR . DIRECTORY_SEPARATOR;
77
require __DIR__ . '/../../AllRegistries/listpackages/multiple.channels.template';
88

99
$test->assertEquals(true, isset($reg->package['pear2.php.net/HooHa']), 'offsetExists');
@@ -19,7 +19,6 @@ $test->assertEquals(true, isset($reg->package['pear2.php.net/HooHa']), 'offsetSe
1919
===DONE===
2020
--CLEAN--
2121
<?php
22-
$dir = __DIR__ . '/testit';
2322
include __DIR__ . '/../../../clean.php.inc';
2423
?>
2524
--EXPECT--

0 commit comments

Comments
 (0)