1616--FILE--
1717<?php
1818require __DIR__ . '/setup.php.inc ' ;
19- if (file_exists (__DIR__ . DIRECTORY_SEPARATOR . ' testit ' )) {
20- $ dir = __DIR__ . ' /testit ' ;
19+ if (file_exists (TESTDIR )) {
20+ $ dir = TESTDIR ;
2121 include __DIR__ . '/../../clean.php.inc ' ;
2222}
23- mkdir (__DIR__ . DIRECTORY_SEPARATOR . ' testit ' );
24- set_include_path (dirname ( __FILE__ ) . DIRECTORY_SEPARATOR . ' testit ' );
25- $ c = \PEAR2 \Pyrus \Config::singleton (__DIR__ . ' /testit ' , __DIR__ . '/testit /plugins/pearconfig.xml ' );
26- $ c ->bin_dir = __DIR__ . '/testit /bin ' ;
27- $ c ->ext_dir = __DIR__ . '/testit /ext ' ;
23+ mkdir (TESTDIR );
24+ set_include_path (TESTDIR );
25+ $ c = \PEAR2 \Pyrus \Config::singleton (TESTDIR , TESTDIR . '/plugins/pearconfig.xml ' );
26+ $ c ->bin_dir = TESTDIR . '/bin ' ;
27+ $ c ->ext_dir = TESTDIR . '/ext ' ;
2828restore_include_path ();
2929$ c ->saveConfig ();
3030
3131ob_start ();
3232$ cli = new \PEAR2 \Pyrus \ScriptFrontend \Commands (true );
33- $ cli ->run ($ args = array (__DIR__ . ' /testit ' , 'install ' , __DIR__ .'/build/docblock-0.2.0.tar ' ));
33+ $ cli ->run ($ args = array (TESTDIR , 'install ' , __DIR__ .'/build/docblock-0.2.0.tar ' ));
3434
3535$ contents = ob_get_contents ();
3636ob_end_clean ();
37- $ test ->assertEquals ('Using PEAR installation found at ' . __DIR__ . DIRECTORY_SEPARATOR . ' testit ' . "\n"
37+ $ test ->assertEquals ('Using PEAR installation found at ' . TESTDIR . "\n"
3838 . 'Installed pecl.php.net/docblock-0.2.0 ' . "\n"
3939 . " ==> To build this PECL package, use the build command \n" ,
4040 $ contents ,
@@ -45,21 +45,21 @@ $test->assertEquals('1.4.3', \PEAR2\Pyrus\Config::current()->registry->package['
4545 ->dependencies ['required ' ]->pearinstaller ->min , 'same after installation ' );
4646
4747ob_start ();
48- $ cli ->run ($ args = array (__DIR__ . ' /testit ' , 'build ' , 'pecl/docblock ' ));
48+ $ cli ->run ($ args = array (TESTDIR , 'build ' , 'pecl/docblock ' ));
4949$ contents = ob_get_contents ();
5050ob_end_clean ();
5151
52- $ start = 'Using PEAR installation found at ' . __DIR__ . '/testit
52+ $ start = 'Using PEAR installation found at ' . TESTDIR . '
5353Building PECL extensions
54- cleaning build directory ' . __DIR__ . '/testit /src/docblock
54+ cleaning build directory ' . TESTDIR . '/src/docblock
5555running: phpize --clean 2>&1
5656Cleaning..
57- building in ' . __DIR__ . '/testit /src/docblock
57+ building in ' . TESTDIR . '/src/docblock
5858running: phpize 2>&1
5959Configuring for: ' ;
6060
61- $ end = '@running: make INSTALL_ROOT=" ' . __DIR__ . '/testit /src/docblock/\.install" install 2>&1
62- Installing shared extensions: ' . __DIR__ . '/testit /src/docblock/\.install ' .
61+ $ end = '@running: make INSTALL_ROOT=" ' . TESTDIR . '/src/docblock/\.install" install 2>&1
62+ Installing shared extensions: ' . TESTDIR . '/src/docblock/\.install ' .
6363 \PEAR2 \Pyrus \Config::current ()->defaultValue ('ext_dir ' ) . '/
6464\d+ \d drwxr\-xr\-x 3 \w+ \w+\s+4096 \d{4}\-\d{2}\-\d{2} \d{2}:\d{2} ' . __DIR__ .
6565 '/testit/src/docblock/\.install/usr
@@ -75,7 +75,7 @@ Installing shared extensions: ' . __DIR__ . '/testit/src/docblock/\.install'
7575 '/testit/src/docblock/\.install/usr/local/lib/php/extensions/[^/]+
7676\d+ \d+ \-rwxr\-xr\-x 1 \w+ \w+\s+\d+ \d{4}\-\d{2}\-\d{2} \d{2}:\d{2} ' . __DIR__ .
7777 '/testit/src/docblock/\.install/usr/local/lib/php/extensions/[^/]+/docblock\.so
78- Installing \'' . __DIR__ . '/testit /ext/docblock\.so \'
78+ Installing \'' . TESTDIR . '/ext/docblock\.so \'
7979@ ' ;
8080
8181$ test ->assertEquals ($ start , substr ($ contents , 0 , strlen ($ start )), 'beginning of contents ' );
@@ -85,7 +85,6 @@ $test->assertRegex($end, substr($contents, strpos($contents, 'running: make INST
8585===DONE===
8686--CLEAN--
8787<?php
88- $ dir = __DIR__ . '/testit ' ;
8988include __DIR__ . '/../../clean.php.inc ' ;
9089?>
9190--EXPECT--
0 commit comments