com phpruntests: Fixed test to work with refactored rtRuntestsConfiguration.: tests/configuration/preconditions/rtIfParallelHasPcntlTest.php

From: Date: Tue, 12 May 2009 22:28:57 +0000
Subject: com phpruntests: Fixed test to work with refactored rtRuntestsConfiguration.: tests/configuration/preconditions/rtIfParallelHasPcntlTest.php
Groups: php.qa 
Request: Send a blank email to php-qa+get-66478@lists.php.net to get a copy of this message
Commit: 9ec47009ca9809e4f80436924cf9621eebdd7aa9 Author: Stefan Priebsch <spriebsch@php.net> Tue, 12 May 2009 22:28:57 +0000 Parents: 35992b774c687c9b787ef828eff6228c11fad82e Branches: master Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=9ec47009ca9809e4f80436924cf9621eebdd7aa9 Log: Fixed test to work with refactored rtRuntestsConfiguration. Changed paths: M tests/configuration/preconditions/rtIfParallelHasPcntlTest.php Diff: diff --git a/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php b/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php index fd7b21a..c60ccf5 100644 --- a/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php +++ b/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php @@ -30,16 +30,11 @@ class rtIfParallelHasPcntlTest extends PHPUnit_Framework_TestCase protected function setUp() { $this->preCondition = new rtIfParallelHasPcntl(); - $this->commandLine = new rtCommandLineOptions(); - - $this->environment = rtEnvironmentVariables::getInstance(); } protected function tearDown() { unset($this->preCondition); - unset($this->commandLine); - unset($this->environment); } /** @@ -48,9 +43,9 @@ class rtIfParallelHasPcntlTest extends PHPUnit_Framework_TestCase */ public function testCheckWhenCommandLineOptionIsSet() { - $this->commandLine->parse(array('run-tests.php', '-z')); + $runtestsConfiguration = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-z')); - $this->assertEquals(extension_loaded('pcntl'), $this->preCondition->check($this->commandLine, $this->environment)); + $this->assertEquals(extension_loaded('pcntl'), $this->preCondition->check($runtestsConfiguration)); } /** @@ -59,9 +54,10 @@ class rtIfParallelHasPcntlTest extends PHPUnit_Framework_TestCase */ public function testCheckWhenEnvironmentVariableIsSet() { - $this->environment->setVariable('TEST_PHP_PARALLEL', true); + $runtestsConfiguration = rtRuntestsConfiguration::getInstance(array()); + $runtestsConfiguration->setEnvironmentVariable('TEST_PHP_PARALLEL', true); - $this->assertTrue($this->preCondition->check($this->commandLine, $this->environment)); + $this->assertTrue($this->preCondition->check($runtestsConfiguration)); } /** @@ -69,7 +65,9 @@ class rtIfParallelHasPcntlTest extends PHPUnit_Framework_TestCase */ public function testCheckWhenParallelExecutionIsNotRequired() { - $this->assertTrue($this->preCondition->check($this->commandLine, $this->environment)); + $runtestsConfiguration = rtRuntestsConfiguration::getInstance(array()); + + $this->assertTrue($this->preCondition->check($runtestsConfiguration)); } /**

« previous php.qa (#66478) next »