Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add a simple test file and better phpunit finding

  • Loading branch information...
commit f8281339ca8513dcd2c2519c80e9df1b5e262b32 1 parent 61fbf8b
@jlipps authored
Showing with 43 additions and 4 deletions.
  1. +15 −2 bin/paraunit
  2. +2 −2 composer.json
  3. +26 −0 test.php
View
17 bin/paraunit
@@ -201,10 +201,23 @@ function main($argv)
$processes = intval($opts['p']);
else
$processes = 1;
- if (isset($opts['phpunit']))
+ if (isset($opts['phpunit'])) {
$PHPUNIT = $opts['phpunit'];
+ if ($PHPUNIT[0] != '/') {
+ $PHPUNIT = getcwd(). '/' . $PHPUNIT;
+ }
+ }
+
+ if ($PHPUNIT != 'phpunit' && !is_file($PHPUNIT))
+ die("Couldn't find phpunit at '$PHPUNIT'\n");
+
+ //if ($opts['path'][0] != '/')
+ //$opts['path'] = getcwd().'/'.$opts['path'];
+
+ $files = getFiles($opts['path'], getcwd());
- $files = getFiles($opts['path'], dirname(__FILE__));
+ if (!count($files))
+ die("Couldn't find any tests with path '{$opts['path']}'\n");
$all_tests = array();
foreach($files as $file) {
View
4 composer.json
@@ -2,9 +2,9 @@
"name": "jlipps/paraunit",
"require": {
"php": ">=5.3.0",
- "phpunit/phpunit": "dev-master"
+ "phpunit/phpunit": ">=3.7.1"
},
- "minimum_stability": "dev",
+ "minimum-stability": "dev",
"type": "library",
"description": "A parallel execution wrapper for PHPUnit",
"keywords": ["testing","PHPUnit"],
View
26 test.php
@@ -0,0 +1,26 @@
+<?php
+require_once 'vendor/autoload.php';
+
+class ArrayTest extends PHPUnit_Framework_TestCase
+{
+ public function testNewArrayIsEmpty()
+ {
+ // Create the Array fixture.
+ $fixture = array();
+
+ // Assert that the size of the Array fixture is 0.
+ $this->assertEquals(0, sizeof($fixture));
+ }
+
+ public function testArrayContainsAnElement()
+ {
+ // Create the Array fixture.
+ $fixture = array();
+
+ // Add an element to the Array fixture.
+ $fixture[] = 'Element';
+
+ // Assert that the size of the Array fixture is 1.
+ $this->assertEquals(1, sizeof($fixture));
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.