com phpruntests: Change the tests to use the TestBootstrap for PHP defs: tests/configuration/rtPreconditionListTest.php
tests/configuration/rtRuntestsConfigurationTest.php tests/testcase/rtCleanExecutionTest.php tests/testcase/rtCookieExecutionTest.php
tests/testcase/rtDeflatePostExecutionTest.php tests/testcase/rtFileExternalExecutionTest.php tests/testcase/rtGetExecutionTest.php
tests/testcase/rtGzipPostExecutionTest.php tests/testcase/rtPhpRun

From: Date: Thu, 10 May 2012 10:49:40 +0000
Subject: com phpruntests: Change the tests to use the TestBootstrap for PHP defs: tests/configuration/rtPreconditionListTest.php
tests/configuration/rtRuntestsConfigurationTest.php tests/testcase/rtCleanExecutionTest.php tests/testcase/rtCookieExecutionTest.php
tests/testcase/rtDeflatePostExecutionTest.php tests/testcase/rtFileExternalExecutionTest.php tests/testcase/rtGetExecutionTest.php
tests/testcase/rtGzipPostExecutionTest.php tests/testcase/rtPhpRun
Groups: php.qa 
Request: Send a blank email to php-qa+get-66287@lists.php.net to get a copy of this message
Commit: 6e7a69ab6338792fd5aa277eebf00a4c952d5027 Author: Zoe Slattery <zoe@php.net> Thu, 10 May 2012 10:49:40 +0000 Parents: b1ddef2e426054bb1ccee09bcd3be906ca888d1d Branches: master Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=6e7a69ab6338792fd5aa277eebf00a4c952d5027 Log: Change the tests to use the TestBootstrap for PHP defs Changed paths: M tests/configuration/rtPreconditionListTest.php M tests/configuration/rtRuntestsConfigurationTest.php M tests/testcase/rtCleanExecutionTest.php M tests/testcase/rtCookieExecutionTest.php M tests/testcase/rtDeflatePostExecutionTest.php M tests/testcase/rtFileExternalExecutionTest.php M tests/testcase/rtGetExecutionTest.php M tests/testcase/rtGzipPostExecutionTest.php M tests/testcase/rtPhpRunnerTest.php M tests/testcase/rtPhpTestTest.php M tests/testcase/rtPostExecutionTest.php M tests/testcase/rtPostRawExecutionTest.php M tests/testcase/rtSkipIfExecutionTest.php M tests/testcase/rtTestConfigurationTest.php M tests/testcase/rtTestExecutionTest.php M tests/testcase/rtTestOutputWriterTest.php M tests/testcase/rtTestResultsTest.php

diff --git a/tests/configuration/rtPreconditionListTest.php b/tests/configuration/rtPreconditionListTest.php index b375a0c..08107e4 100644 --- a/tests/configuration/rtPreconditionListTest.php +++ b/tests/configuration/rtPreconditionListTest.php @@ -12,6 +12,7 @@ */ require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; /** * Tests for rtPreCondtionListTest precondition. @@ -38,10 +39,9 @@ class rtPreCondtionListTest extends PHPUnit_Framework_TestCase public function testCheck() { - $php = trim(shell_exec("which php")); $preConditionList = rtPreConditionList::getInstance(); - $runtestsConfiguration = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $php, 'a-test.phpt')); + $runtestsConfiguration = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'a-test.phpt')); $runtestsConfiguration->configure(); $this->assertTrue($preConditionList->check($runtestsConfiguration)); diff --git a/tests/configuration/rtRuntestsConfigurationTest.php b/tests/configuration/rtRuntestsConfigurationTest.php index 9ef905d..6f6f3c5 100644 --- a/tests/configuration/rtRuntestsConfigurationTest.php +++ b/tests/configuration/rtRuntestsConfigurationTest.php @@ -1,33 +1,33 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtRuntestsConfigurationTest extends PHPUnit_Framework_TestCase { public function setUp() { - $this->php = trim(shell_exec("which php")); } public function testCreateUnix() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, 'test.phpt')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'test.phpt')); $config->configure(); $testFiles = $config->getSetting('TestFiles'); - $this->assertEquals($this->php, $config->getSetting('PhpExecutable')); + $this->assertEquals(RT_PHP_PATH, $config->getSetting('PhpExecutable')); $this->assertEquals('test.phpt', $testFiles[0]); } public function testCreateWin() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, 'test.phpt'), 'Windows'); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'test.phpt'), 'Windows'); $config->configure(); $testFiles = $config->getSetting('TestFiles'); - $this->assertEquals($this->php, $config->getSetting('PhpExecutable')); + $this->assertEquals(RT_PHP_PATH, $config->getSetting('PhpExecutable')); $this->assertEquals('test.phpt', $testFiles[0]); } } diff --git a/tests/testcase/rtCleanExecutionTest.php b/tests/testcase/rtCleanExecutionTest.php index 220e45f..b48ecc8 100644 --- a/tests/testcase/rtCleanExecutionTest.php +++ b/tests/testcase/rtCleanExecutionTest.php @@ -1,6 +1,7 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtCleanExecutionTest extends PHPUnit_Framework_TestCase { @@ -10,8 +11,6 @@ class rtCleanExecutionTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->php = trim(shell_exec("which php")); - $this->path_to_tests = realpath(dirname(__FILE__) . '/../../phpt-tests'); $this->sample_test = $this->path_to_tests . '/sample_clean.phpt'; $this->sample_fail = $this->path_to_tests . '/sample_clean_fail.phpt'; @@ -27,7 +26,7 @@ class rtCleanExecutionTest extends PHPUnit_Framework_TestCase public function testFileRun() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); $config->configure(); //Retrieve the array of test file names @@ -55,7 +54,7 @@ class rtCleanExecutionTest extends PHPUnit_Framework_TestCase public function testFailedClean() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_fail)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_fail)); $config->configure(); //Retrieve the array of test file names diff --git a/tests/testcase/rtCookieExecutionTest.php b/tests/testcase/rtCookieExecutionTest.php index 3ac5280..67591ac 100644 --- a/tests/testcase/rtCookieExecutionTest.php +++ b/tests/testcase/rtCookieExecutionTest.php @@ -1,6 +1,7 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtCookieExecutionTest extends PHPUnit_Framework_TestCase { @@ -9,10 +10,7 @@ class rtCookieExecutionTest extends PHPUnit_Framework_TestCase private $sample_fail; public function setUp() - { - $this->php = trim(shell_exec("which php")); - $this->php_cgi = trim(shell_exec("which php-cgi")); - + { $this->path_to_tests = realpath(dirname(__FILE__) . '/../../phpt-tests'); $this->sample_test = $this->path_to_tests . '/sample_cookie.phpt'; } @@ -25,8 +23,8 @@ class rtCookieExecutionTest extends PHPUnit_Framework_TestCase public function testFileRun() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); - $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE',$this->php_cgi); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); + $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE',RT_PHP_CGI_PATH); $config->configure(); //Retrieve the array of test file names diff --git a/tests/testcase/rtDeflatePostExecutionTest.php b/tests/testcase/rtDeflatePostExecutionTest.php index 9ae7bd5..6ede533 100644 --- a/tests/testcase/rtDeflatePostExecutionTest.php +++ b/tests/testcase/rtDeflatePostExecutionTest.php @@ -1,6 +1,7 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtDeflatePostExecutionTest extends PHPUnit_Framework_TestCase { @@ -8,9 +9,6 @@ class rtDeflatePostExecutionTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->php = trim(shell_exec("which php")); - $this->php_cgi = trim(shell_exec("which php-cgi")); - $this->path_to_tests = realpath(dirname(__FILE__) . '/../../phpt-tests'); $this->sample_test = $this->path_to_tests . '/sample_deflatepost.phpt'; } @@ -23,8 +21,8 @@ class rtDeflatePostExecutionTest extends PHPUnit_Framework_TestCase public function testFileRun() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); - $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE',$this->php_cgi); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); + $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE', RT_PHP_CGI_PATH); $config->configure(); //Retrieve the array of test file names diff --git a/tests/testcase/rtFileExternalExecutionTest.php b/tests/testcase/rtFileExternalExecutionTest.php index ac5c116..0a21b79 100644 --- a/tests/testcase/rtFileExternalExecutionTest.php +++ b/tests/testcase/rtFileExternalExecutionTest.php @@ -1,6 +1,7 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtFileExternalExecutionTest extends PHPUnit_Framework_TestCase { @@ -10,8 +11,6 @@ class rtFileExternalExecutionTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->php = trim(shell_exec("which php")); - $this->path_to_tests = realpath(dirname(__FILE__) . '/../../phpt-tests'); $this->sample_test = $this->path_to_tests . '/sample_fileexternal.phpt'; $this->sample_fail1 = $this->path_to_tests . '/sample_fileexternal1.phpt'; @@ -26,7 +25,7 @@ class rtFileExternalExecutionTest extends PHPUnit_Framework_TestCase public function testFileRun() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); $config->configure(); //Retrieve the array of test file names @@ -52,7 +51,7 @@ class rtFileExternalExecutionTest extends PHPUnit_Framework_TestCase public function testFail1() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_fail1)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_fail1)); $config->configure(); //Retrieve the array of test file names @@ -78,7 +77,7 @@ class rtFileExternalExecutionTest extends PHPUnit_Framework_TestCase public function testFail2() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_fail2)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_fail2)); $config->configure(); //Retrieve the array of test file names diff --git a/tests/testcase/rtGetExecutionTest.php b/tests/testcase/rtGetExecutionTest.php index 52cac59..9d5703a 100644 --- a/tests/testcase/rtGetExecutionTest.php +++ b/tests/testcase/rtGetExecutionTest.php @@ -1,6 +1,7 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtGetExecutionTest extends PHPUnit_Framework_TestCase { @@ -10,8 +11,6 @@ class rtGetExecutionTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->php = trim(shell_exec("which php")); - $this->php_cgi = trim(shell_exec("which php-cgi")); $this->path_to_tests = realpath(dirname(__FILE__) . '/../../phpt-tests'); $this->sample_test = $this->path_to_tests . '/sample_get.phpt'; @@ -25,8 +24,8 @@ class rtGetExecutionTest extends PHPUnit_Framework_TestCase public function testFileRun() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); - $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE',$this->php_cgi); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); + $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE', RT_PHP_CGI_PATH); $config->configure(); //Retrieve the array of test file names @@ -56,7 +55,7 @@ class rtGetExecutionTest extends PHPUnit_Framework_TestCase public function testNoCGI() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE', null); $config->configure(); diff --git a/tests/testcase/rtGzipPostExecutionTest.php b/tests/testcase/rtGzipPostExecutionTest.php index 3d2748e..f1abc2c 100644 --- a/tests/testcase/rtGzipPostExecutionTest.php +++ b/tests/testcase/rtGzipPostExecutionTest.php @@ -1,6 +1,7 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtGzipPostExecutionTest extends PHPUnit_Framework_TestCase { @@ -8,9 +9,6 @@ class rtGzipPostExecutionTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->php = trim(shell_exec("which php")); - $this->php_cgi = trim(shell_exec("which php-cgi")); - $this->path_to_tests = realpath(dirname(__FILE__) . '/../../phpt-tests'); $this->sample_test = $this->path_to_tests . '/sample_gzippost.phpt'; } @@ -23,8 +21,8 @@ class rtGzipPostExecutionTest extends PHPUnit_Framework_TestCase public function testFileRun() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); - $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE',$this->php_cgi); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); + $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE', RT_PHP_CGI_PATH); $config->configure(); //Retrieve the array of test file names diff --git a/tests/testcase/rtPhpRunnerTest.php b/tests/testcase/rtPhpRunnerTest.php index b4d8be6..6319beb 100644 --- a/tests/testcase/rtPhpRunnerTest.php +++ b/tests/testcase/rtPhpRunnerTest.php @@ -1,13 +1,12 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtPhpRunnerTest extends PHPUnit_Framework_TestCase { public function setUp() { - $this->php = trim(shell_exec("which php")); - $fh = fopen('/tmp/test.php', 'w'); fwrite($fh, '<?php echo "hello world"; ?>'); fclose($fh); @@ -25,14 +24,14 @@ class rtPhpRunnerTest extends PHPUnit_Framework_TestCase public function testSimple() { - $PhpRunner = new rtPhpRunner($this->php . ' -n /tmp/test.php 2>&1', array(), '/tmp'); + $PhpRunner = new rtPhpRunner(RT_PHP_PATH . ' -n /tmp/test.php 2>&1', array(), '/tmp'); $this->assertEquals("hello world", $PhpRunner->runphp()); } public function testStdin() { - $PhpRunner = new rtPhpRunner($this->php .' -n /tmp/test2.php 2>&1', array(), '/tmp', 'hello'); + $PhpRunner = new rtPhpRunner(RT_PHP_PATH .' -n /tmp/test2.php 2>&1', array(), '/tmp', 'hello'); $this->assertEquals("hello", $PhpRunner->runphp()); } diff --git a/tests/testcase/rtPhpTestTest.php b/tests/testcase/rtPhpTestTest.php index 2e7e8ce..132cb55 100644 --- a/tests/testcase/rtPhpTestTest.php +++ b/tests/testcase/rtPhpTestTest.php @@ -1,12 +1,12 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtPhpTestTest extends PHPUnit_Framework_TestCase { public function setUp() { - $this->php = trim(shell_exec("which php")); $this->testCase = array ( '--TEST--', 'This is a test', @@ -43,7 +43,7 @@ class rtPhpTestTest extends PHPUnit_Framework_TestCase public function testCreateInstance() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, 'test.phpt')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'test.phpt')); $config->configure(); $status = new rtTestStatus('nameOfTest'); @@ -54,7 +54,7 @@ class rtPhpTestTest extends PHPUnit_Framework_TestCase public function testSections() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, 'test.phpt')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'test.phpt')); $config->configure(); $status = new rtTestStatus('nameOfTest'); @@ -67,7 +67,7 @@ class rtPhpTestTest extends PHPUnit_Framework_TestCase public function testDone() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, 'test.phpt')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'test.phpt')); $config->configure(); $status = new rtTestStatus('nameOfTest'); @@ -83,7 +83,7 @@ class rtPhpTestTest extends PHPUnit_Framework_TestCase public function testEmptySection() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, 'test.phpt')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'test.phpt')); $config->configure(); $status = new rtTestStatus('nameOfTest'); diff --git a/tests/testcase/rtPostExecutionTest.php b/tests/testcase/rtPostExecutionTest.php index bcb653f..e77b18a 100644 --- a/tests/testcase/rtPostExecutionTest.php +++ b/tests/testcase/rtPostExecutionTest.php @@ -1,6 +1,7 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtPostExecutionTest extends PHPUnit_Framework_TestCase { @@ -8,8 +9,6 @@ class rtPostExecutionTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->php = trim(shell_exec("which php")); - $this->php_cgi = trim(shell_exec("which php-cgi")); $this->path_to_tests = realpath(dirname(__FILE__) . '/../../phpt-tests'); $this->sample_test = $this->path_to_tests . '/sample_post.phpt'; @@ -23,8 +22,8 @@ class rtPostExecutionTest extends PHPUnit_Framework_TestCase public function testFileRun() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); - $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE',$this->php_cgi); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); + $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE', RT_PHP_CGI_PATH); $config->configure(); //Retrieve the array of test file names diff --git a/tests/testcase/rtPostRawExecutionTest.php b/tests/testcase/rtPostRawExecutionTest.php index 2ab1fbb..0cebd90 100644 --- a/tests/testcase/rtPostRawExecutionTest.php +++ b/tests/testcase/rtPostRawExecutionTest.php @@ -1,6 +1,7 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtPostRawExecutionTest extends PHPUnit_Framework_TestCase { @@ -8,9 +9,7 @@ class rtPostRawExecutionTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->php = trim(shell_exec("which php")); - $this->php_cgi = trim(shell_exec("which php-cgi")); - + $this->path_to_tests = realpath(dirname(__FILE__) . '/../../phpt-tests'); $this->sample_test = $this->path_to_tests . '/sample_postraw.phpt'; } @@ -23,8 +22,8 @@ class rtPostRawExecutionTest extends PHPUnit_Framework_TestCase public function testFileRun() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); - $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE',$this->php_cgi); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); + $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE', RT_PHP_CGI_PATH); $config->configure(); //Retrieve the array of test file names diff --git a/tests/testcase/rtSkipIfExecutionTest.php b/tests/testcase/rtSkipIfExecutionTest.php index 4501e2c..9084e2e 100644 --- a/tests/testcase/rtSkipIfExecutionTest.php +++ b/tests/testcase/rtSkipIfExecutionTest.php @@ -1,6 +1,7 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtSkipIfExecutionTest extends PHPUnit_Framework_TestCase { @@ -8,7 +9,6 @@ class rtSkipIfExecutionTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->php = trim(shell_exec("which php")); $path_to_tests = realpath(dirname(__FILE__) . '/../../phpt-tests'); $this->sample_test = $path_to_tests . '/sample_skipif.phpt'; } @@ -21,7 +21,7 @@ class rtSkipIfExecutionTest extends PHPUnit_Framework_TestCase public function testFileRun() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); $config->configure(); //Retrieve the array of test file names diff --git a/tests/testcase/rtTestConfigurationTest.php b/tests/testcase/rtTestConfigurationTest.php index dd268c1..8691f1a 100644 --- a/tests/testcase/rtTestConfigurationTest.php +++ b/tests/testcase/rtTestConfigurationTest.php @@ -1,6 +1,7 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtTestConfigurationTest extends PHPUnit_Framework_TestCase { @@ -8,7 +9,6 @@ class rtTestConfigurationTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->php = $this->php = trim(shell_exec("which php")); $this->sections['ARGS'] = rtArgsSection::getInstance('ARGS', array('-vvv -a value -1111 -2 -v'), 'testname'); $this->sections['ENV'] = rtEnvSection::getInstance('ENV', array('env1 = ENV1', 'env2=ENV2'), 'testname'); @@ -19,7 +19,7 @@ class rtTestConfigurationTest extends PHPUnit_Framework_TestCase public function testCreateInstance() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, 'test.phpt')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'test.phpt')); $config->configure(); $testConfiguration = new rtTestConfiguration($config, $this->sections, array(),$this->sections['FILE']); @@ -29,7 +29,7 @@ class rtTestConfigurationTest extends PHPUnit_Framework_TestCase public function testEnv() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, 'test.phpt')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'test.phpt')); $config->configure(); $testConfiguration = new rtTestConfiguration($config, $this->sections, array(), $this->sections['FILE']); @@ -41,7 +41,7 @@ class rtTestConfigurationTest extends PHPUnit_Framework_TestCase public function testArgs() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, 'test.phpt')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'test.phpt')); $config->configure(); $testConfiguration = new rtTestConfiguration($config, $this->sections, array(),$this->sections['FILE']); @@ -53,7 +53,7 @@ class rtTestConfigurationTest extends PHPUnit_Framework_TestCase public function testIni() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, 'test.phpt')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'test.phpt')); $config->configure(); $testConfiguration = new rtTestConfiguration($config, $this->sections, array(),$this->sections['FILE']); @@ -65,18 +65,18 @@ class rtTestConfigurationTest extends PHPUnit_Framework_TestCase public function testPHPExecutable() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, 'test.phpt')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'test.phpt')); $config->configure(); $testConfiguration = new rtTestConfiguration($config, $this->sections, array(),$this->sections['FILE']); $phpExe = $testConfiguration->getPhpExecutable(); - $this->assertEquals($this->php, $phpExe); + $this->assertEquals(RT_PHP_PATH, $phpExe); } public function testPHPCgiExecutable() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, 'test.phpt')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, 'test.phpt')); $config->setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE', 'a-php-cgi-exe'); $config->configure(); diff --git a/tests/testcase/rtTestExecutionTest.php b/tests/testcase/rtTestExecutionTest.php index 1fc754a..1ade202 100644 --- a/tests/testcase/rtTestExecutionTest.php +++ b/tests/testcase/rtTestExecutionTest.php @@ -1,6 +1,7 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtTestExecutionTest extends PHPUnit_Framework_TestCase { @@ -12,7 +13,6 @@ class rtTestExecutionTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->php = trim(shell_exec("which php")); $this->path_to_tests = realpath(dirname(__FILE__) . '/../../phpt-tests'); $this->sample_test = $this->path_to_tests . '/sample_test.phpt'; $this->sample_expectf = $this->path_to_tests . '/sample_expectf.phpt'; @@ -31,7 +31,7 @@ class rtTestExecutionTest extends PHPUnit_Framework_TestCase public function testFileRun() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); $config->configure(); //Retrieve the array of test file names @@ -57,7 +57,7 @@ class rtTestExecutionTest extends PHPUnit_Framework_TestCase public function testFileRunDone() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_done)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_done)); $config->configure(); //Retrieve the array of test file names @@ -83,7 +83,7 @@ class rtTestExecutionTest extends PHPUnit_Framework_TestCase public function testFileRunAndCompare() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); $config->configure(); //Retrieve the array of test file names @@ -112,7 +112,7 @@ class rtTestExecutionTest extends PHPUnit_Framework_TestCase public function testExpectFFileRunAndCompare() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_expectf)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_expectf)); $config->configure(); //Retrieve the array of test file names @@ -142,7 +142,7 @@ class rtTestExecutionTest extends PHPUnit_Framework_TestCase public function testExpectRegexFileRunAndCompare() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_expectregex)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_expectregex)); $config->configure(); //Retrieve the array of test file names diff --git a/tests/testcase/rtTestOutputWriterTest.php b/tests/testcase/rtTestOutputWriterTest.php index b1b3c90..ee446b3 100644 --- a/tests/testcase/rtTestOutputWriterTest.php +++ b/tests/testcase/rtTestOutputWriterTest.php @@ -6,7 +6,6 @@ class rtTestOutputWriterTest extends PHPUnit_Framework_TestCase { public function setUp() { - $this->php = trim(shell_exec("which php")); $this->path_to_tests = realpath(dirname(__FILE__) . '/../../phpt-tests'); $this->sample_test = $this->path_to_tests . '/sample_test.phpt'; $this->sample_test_fail = $this->path_to_tests . '/sample_test_fail.phpt'; @@ -29,7 +28,7 @@ class rtTestOutputWriterTest extends PHPUnit_Framework_TestCase public function testFailedTest() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test_fail)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test_fail)); $config->configure(); //Retrieve the array of test file names diff --git a/tests/testcase/rtTestResultsTest.php b/tests/testcase/rtTestResultsTest.php index 889fe0e..643b115 100644 --- a/tests/testcase/rtTestResultsTest.php +++ b/tests/testcase/rtTestResultsTest.php @@ -1,12 +1,12 @@ <?php require_once dirname(__FILE__) . '../../../src/rtAutoload.php'; +require_once dirname(__FILE__) . '/../rtTestBootstrap.php'; class rtTestResultsTest extends PHPUnit_Framework_TestCase { public function setUp() { - $this->php = trim(shell_exec("which php")); $this->path_to_tests = realpath(dirname(__FILE__) . '/../../phpt-tests'); $this->sample_test = $this->path_to_tests. '/sample_test.phpt'; $this->sample_test_fail = $this->path_to_tests. '/sample_test_fail.phpt'; @@ -32,7 +32,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase public function testFileDelete() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test)); $config->configure(); //Retrieve the array of test file names @@ -62,7 +62,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase public function testFileSaveAll() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test, '--keep-all')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test, '--keep-all')); $config->configure(); //Retrieve the array of test file names @@ -92,7 +92,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase public function testFileSavePHP() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test, '--keep-php')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test, '--keep-php')); $config->configure(); //Retrieve the array of test file names @@ -122,7 +122,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase public function testFailedTest() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_test_fail)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_test_fail)); $config->configure(); //Retrieve the array of test file names @@ -155,7 +155,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase public function testSkippedTest() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_skipif)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_skipif)); $config->configure(); //Retrieve the array of test file names @@ -186,7 +186,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase public function testSkippedTestKeep() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_skipif, '--keep-all')); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_skipif, '--keep-all')); $config->configure(); //Retrieve the array of test file names @@ -216,7 +216,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase public function testCleanPass() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_clean)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_clean)); $config->configure(); //Retrieve the array of test file names @@ -247,7 +247,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase public function testBork() { //Create a new test configuration - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', $this->php, $this->sample_bork)); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', RT_PHP_PATH, $this->sample_bork)); $config->configure(); //Retrieve the array of test file names
« previous php.qa (#66287) next »