[PHP-CVS] cvs: phpruntests /tests/configuration/preconditions rtIfParallelHasPcntlTest.php

2009-06-27 Thread Zoe Slattery
zoe Sat Jun 27 13:23:17 2009 UTC

  Modified files:  
/phpruntests/tests/configuration/preconditions  

rtIfParallelHasPcntlTest.php 
  Log:
  fixing test to provide argument to -z
  
http://cvs.php.net/viewvc.cgi/phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php?r1=1.6r2=1.7diff_format=u
Index: 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php
diff -u 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.6 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.7
--- 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.6  
Tue May 12 22:41:20 2009
+++ phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php  
Sat Jun 27 13:23:17 2009
@@ -43,7 +43,7 @@
  */
 public function testCheckWhenCommandLineOptionIsSet()
 {
-$runtestsConfiguration = 
rtRuntestsConfiguration::getInstance(array('run-tests.php', '-z'));
+$runtestsConfiguration = 
rtRuntestsConfiguration::getInstance(array('run-tests.php', '-z', '1'));
 
 $this-assertEquals(extension_loaded('pcntl'), 
$this-preCondition-check($runtestsConfiguration));
 }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: phpruntests /tests/configuration/preconditions rtIfParallelHasPcntlTest.php

2009-05-12 Thread Stefan Priebsch
spriebsch   Tue May 12 22:28:57 2009 UTC

  Modified files:  
/phpruntests/tests/configuration/preconditions  

rtIfParallelHasPcntlTest.php 
  Log:
  Fixed test to work with refactored rtRuntestsConfiguration.
  
  
http://cvs.php.net/viewvc.cgi/phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php?r1=1.4r2=1.5diff_format=u
Index: 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php
diff -u 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.4 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.5
--- 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.4  
Sat Apr 25 15:39:09 2009
+++ phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php  
Tue May 12 22:28:57 2009
@@ -30,16 +30,11 @@
 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 @@
  */
 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 @@
  */
 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 @@
  */
 public function testCheckWhenParallelExecutionIsNotRequired()
 {
-$this-assertTrue($this-preCondition-check($this-commandLine, 
$this-environment));
+$runtestsConfiguration = rtRuntestsConfiguration::getInstance(array());
+
+$this-assertTrue($this-preCondition-check($runtestsConfiguration));
 }
 
 /**



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: phpruntests /tests/configuration/preconditions rtIfParallelHasPcntlTest.php

2009-05-12 Thread Stefan Priebsch
spriebsch   Tue May 12 22:41:20 2009 UTC

  Modified files:  
/phpruntests/tests/configuration/preconditions  

rtIfParallelHasPcntlTest.php 
  Log:
  Fixed wrong case in method name.
  
  
http://cvs.php.net/viewvc.cgi/phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php?r1=1.5r2=1.6diff_format=u
Index: 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php
diff -u 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.5 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.6
--- 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.5  
Tue May 12 22:28:57 2009
+++ phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php  
Tue May 12 22:41:20 2009
@@ -73,7 +73,7 @@
 /**
  * Ensure that the error message is correct.
  */
-public function testgetMessage()
+public function testGetMessage()
 {
 $this-assertEquals($this-preCondition-getMessage('pcntlNotLoaded'), 
rtText::get('pcntlNotLoaded'));
 }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: phpruntests /tests/configuration/preconditions rtIfParallelHasPcntlTest.php

2009-04-25 Thread Stefan Priebsch
spriebsch   Sat Apr 25 15:13:24 2009 UTC

  Modified files:  
/phpruntests/tests/configuration/preconditions  

rtIfParallelHasPcntlTest.php 
  Log:
  Fixed test to work then no pcntl extension is loaded.
  
  
http://cvs.php.net/viewvc.cgi/phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php?r1=1.2r2=1.3diff_format=u
Index: 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php
diff -u 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.2 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.3
--- 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.2  
Mon Apr 20 20:50:39 2009
+++ phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php  
Sat Apr 25 15:13:24 2009
@@ -13,7 +13,7 @@
 
 $pre = new rtIfParallelHasPcntl();
 
-$this-assertTrue($pre-check($clo, $env));
+$this-assertEquals(extension_loaded('pcntl'), $pre-check($clo, 
$env));
 }
 
 public function testLoaded2()



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: phpruntests /tests/configuration/preconditions rtIfParallelHasPcntlTest.php

2009-04-25 Thread Stefan Priebsch
spriebsch   Sat Apr 25 15:39:09 2009 UTC

  Modified files:  
/phpruntests/tests/configuration/preconditions  

rtIfParallelHasPcntlTest.php 
  Log:
  Refactored test and added comments.
  
  
http://cvs.php.net/viewvc.cgi/phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php?r1=1.3r2=1.4diff_format=u
Index: 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php
diff -u 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.3 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.4
--- 
phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php:1.3  
Sat Apr 25 15:13:24 2009
+++ phpruntests/tests/configuration/preconditions/rtIfParallelHasPcntlTest.php  
Sat Apr 25 15:39:09 2009
@@ -1,49 +1,83 @@
 ?php
+/**
+ * rtIfParallelHasPcntlTest
+ *
+ * @category  Testing
+ * @package   RUNTESTS
+ * @authorZoe Slattery z...@php.net
+ * @authorStefan Priebsch sprieb...@php.net
+ * @copyright 2009 The PHP Group
+ * @license   http://www.php.net/license/3_01.txt PHP License 3.01
+ * @link  http://qa.php.net/
+ */
 
 require_once 'PHPUnit/Framework.php';
 require_once dirname(__FILE__) . '../../../../src/rtAutoload.php';
 
+/**
+ * Tests for rtIfParallelHasPcntlTest precondition.
+ *
+ * @category  Testing
+ * @package   RUNTESTS
+ * @authorZoe Slattery z...@php.net
+ * @authorStefan Priebsch sprieb...@php.net
+ * @copyright 2009 The PHP Group
+ * @license   http://www.php.net/license/3_01.txt PHP License 3.01
+ * @link  http://qa.php.net/
+ */
 class rtIfParallelHasPcntlTest extends PHPUnit_Framework_TestCase
 {
-public function testLoaded()
+protected function setUp()
 {
-$clo = new rtCommandLineOptions();
-$clo-parse(array('run-tests.php', '-z'));
-$env = rtEnvironmentVariables::getInstance();
-
-$pre = new rtIfParallelHasPcntl();
+$this-preCondition = new rtIfParallelHasPcntl();
+$this-commandLine  = new rtCommandLineOptions();
 
-$this-assertEquals(extension_loaded('pcntl'), $pre-check($clo, 
$env));
+$this-environment  = rtEnvironmentVariables::getInstance();
 }
-
-public function testLoaded2()
+
+protected function tearDown()
 {
-$clo = new rtCommandLineOptions();
-$env = rtEnvironmentVariables::getInstance();
-$env-setVariable('TEST_PHP_PARALLEL', true);
-
-$pre = new rtIfParallelHasPcntl();
+unset($this-preCondition);
+unset($this-commandLine);
+unset($this-environment);
+}
 
-$this-assertTrue($pre-check($clo, $env));
+/**
+ * Ensure that check (wether pcntl is loaded) works 
+ * when parallel test execution is requested by command line option.
+ */
+public function testCheckWhenCommandLineOptionIsSet()
+{
+$this-commandLine-parse(array('run-tests.php', '-z'));
+
+$this-assertEquals(extension_loaded('pcntl'), 
$this-preCondition-check($this-commandLine, $this-environment));
 }
-
-public function testNotRequired()
+
+/**
+ * Ensure that check (wether pcntl is loaded) works 
+ * when parallel test execution is requested by environment variable.
+ */
+public function testCheckWhenEnvironmentVariableIsSet()
 {
-$clo = new rtCommandLineOptions();
-$env = rtEnvironmentVariables::getInstance();
+$this-environment-setVariable('TEST_PHP_PARALLEL', true);
 
-$pre = new rtIfParallelHasPcntl();
+$this-assertTrue($this-preCondition-check($this-commandLine, 
$this-environment));
+}
 
-$this-assertTrue($pre-check($clo, $env));
+/**
+ * Ensure that check returns true when no parallel test execution is 
requested.
+ */
+public function testCheckWhenParallelExecutionIsNotRequired()
+{
+$this-assertTrue($this-preCondition-check($this-commandLine, 
$this-environment));
 }
 
+/**
+ * Ensure that the error message is correct.
+ */
 public function testgetMessage()
 {
-$pre = new rtIfParallelHasPcntl();
-  
-$this-assertEquals($pre-getMessage('pcntlNotLoaded'), 
rtText::get('pcntlNotLoaded'));
+$this-assertEquals($this-preCondition-getMessage('pcntlNotLoaded'), 
rtText::get('pcntlNotLoaded'));
 }
-
-//Not sure how to check if it's not loaded?
 }
 ?



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php