Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions PHPUnit/Extensions/PhptTestCase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Zf1s\Compat\Types;

/**
* PHPUnit
*
Expand Down Expand Up @@ -115,12 +118,14 @@ public function count()
/**
* Runs a test and collects its result in a TestResult instance.
*
* @param PHPUnit_Framework_TestResult $result
* @param PHPUnit_Framework_TestResult|null $result
* @param array $options
* @return PHPUnit_Framework_TestResult
*/
public function run(PHPUnit_Framework_TestResult $result = NULL, array $options = array())
public function run($result = NULL, array $options = array())
{
Types::isNullable('result', $result, 'PHPUnit_Framework_TestResult');

if (!class_exists('PEAR_RunTest', FALSE)) {
throw new PHPUnit_Framework_Exception('Class PEAR_RunTest not found.');
}
Expand Down
9 changes: 7 additions & 2 deletions PHPUnit/Extensions/RepeatedTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Zf1s\Compat\Types;

/**
* PHPUnit
*
Expand Down Expand Up @@ -125,12 +128,14 @@ public function count()
* Runs the decorated test and collects the
* result in a TestResult.
*
* @param PHPUnit_Framework_TestResult $result
* @param PHPUnit_Framework_TestResult|null $result
* @return PHPUnit_Framework_TestResult
* @throws PHPUnit_Framework_Exception
*/
public function run(PHPUnit_Framework_TestResult $result = NULL)
public function run($result = NULL)
{
Types::isNullable('result', $result, 'PHPUnit_Framework_TestResult');

if ($result === NULL) {
$result = $this->createResult();
}
Expand Down
9 changes: 7 additions & 2 deletions PHPUnit/Extensions/TestDecorator.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Zf1s\Compat\Types;

/**
* PHPUnit
*
Expand Down Expand Up @@ -134,11 +137,13 @@ public function getTest()
* Runs the decorated test and collects the
* result in a TestResult.
*
* @param PHPUnit_Framework_TestResult $result
* @param PHPUnit_Framework_TestResult|null $result
* @return PHPUnit_Framework_TestResult
*/
public function run(PHPUnit_Framework_TestResult $result = NULL)
public function run($result = NULL)
{
Types::isNullable('result', $result, 'PHPUnit_Framework_TestResult');

if ($result === NULL) {
$result = $this->createResult();
}
Expand Down
9 changes: 7 additions & 2 deletions PHPUnit/Framework/Constraint.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Zf1s\Compat\Types;

/**
* PHPUnit
*
Expand Down Expand Up @@ -123,11 +126,13 @@ public function count()
*
* @param mixed $other Evaluated value or object.
* @param string $description Additional information about the test
* @param PHPUnit_Framework_ComparisonFailure $comparisonFailure
* @param PHPUnit_Framework_ComparisonFailure|null $comparisonFailure
* @throws PHPUnit_Framework_ExpectationFailedException
*/
protected function fail($other, $description, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL)
protected function fail($other, $description, $comparisonFailure = NULL)
{
Types::isNullable('comparisonFailure', $comparisonFailure, 'PHPUnit_Framework_ComparisonFailure');

$failureDescription = sprintf(
'Failed asserting that %s.',
$this->failureDescription($other)
Expand Down
9 changes: 7 additions & 2 deletions PHPUnit/Framework/Error.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Zf1s\Compat\Types;

/**
* PHPUnit
*
Expand Down Expand Up @@ -63,10 +66,12 @@ class PHPUnit_Framework_Error extends Exception
* @param integer $code
* @param string $file
* @param integer $line
* @param Exception $previous
* @param Exception|null $previous
*/
public function __construct($message, $code, $file, $line, Exception $previous = NULL)
public function __construct($message, $code, $file, $line, $previous = NULL)
{
Types::isNullable('previous', $previous, 'Exception');

parent::__construct($message, $code, $previous);

$this->file = $file;
Expand Down
10 changes: 8 additions & 2 deletions PHPUnit/Framework/ExpectationFailedException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Zf1s\Compat\Types;

/**
* PHPUnit
*
Expand Down Expand Up @@ -61,12 +64,15 @@
class PHPUnit_Framework_ExpectationFailedException extends PHPUnit_Framework_AssertionFailedError
{
/**
* @var PHPUnit_Framework_ComparisonFailure
* @var null|PHPUnit_Framework_ComparisonFailure
*/
protected $comparisonFailure;

public function __construct($message, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL, Exception $previous = NULL)
public function __construct($message, $comparisonFailure = NULL, $previous = NULL)
{
Types::isNullable('comparisonFailure', $comparisonFailure, 'PHPUnit_Framework_ComparisonFailure');
Types::isNullable('previous', $previous, 'Exception');

$this->comparisonFailure = $comparisonFailure;

parent::__construct($message, 0, $previous);
Expand Down
2 changes: 1 addition & 1 deletion PHPUnit/Framework/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ interface PHPUnit_Framework_Test extends Countable
* @param PHPUnit_Framework_TestResult $result
* @return PHPUnit_Framework_TestResult
*/
public function run(PHPUnit_Framework_TestResult $result = NULL);
public function run($result = NULL);
}
9 changes: 7 additions & 2 deletions PHPUnit/Framework/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Zf1s\Compat\Types;

/**
* PHPUnit
*
Expand Down Expand Up @@ -672,12 +675,14 @@ public function hasFailed()
* Runs the test case and collects the results in a TestResult object.
* If no TestResult object is passed a new one will be created.
*
* @param PHPUnit_Framework_TestResult $result
* @param PHPUnit_Framework_TestResult|null $result
* @return PHPUnit_Framework_TestResult
* @throws PHPUnit_Framework_Exception
*/
public function run(PHPUnit_Framework_TestResult $result = NULL)
public function run($result = NULL)
{
Types::isNullable('result', $result, 'PHPUnit_Framework_TestResult');

if ($result === NULL) {
$result = $this->createResult();
}
Expand Down
9 changes: 7 additions & 2 deletions PHPUnit/Framework/TestSuite.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Zf1s\Compat\Types;

/**
* PHPUnit
*
Expand Down Expand Up @@ -617,16 +620,18 @@ public function getGroups()
/**
* Runs the tests and collects their result in a TestResult.
*
* @param PHPUnit_Framework_TestResult $result
* @param PHPUnit_Framework_TestResult|null $result
* @param mixed $filter
* @param array $groups
* @param array $excludeGroups
* @param boolean $processIsolation
* @return PHPUnit_Framework_TestResult
* @throws PHPUnit_Framework_Exception
*/
public function run(PHPUnit_Framework_TestResult $result = NULL, $filter = FALSE, array $groups = array(), array $excludeGroups = array(), $processIsolation = FALSE)
public function run($result = NULL, $filter = FALSE, array $groups = array(), array $excludeGroups = array(), $processIsolation = FALSE)
{
Types::isNullable('result', $result, 'PHPUnit_Framework_TestResult');

if ($result === NULL) {
$result = $this->createResult();
}
Expand Down
12 changes: 9 additions & 3 deletions PHPUnit/TextUI/TestRunner.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Zf1s\Compat\Types;

/**
* PHPUnit
*
Expand Down Expand Up @@ -82,12 +85,15 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
protected static $versionStringPrinted = FALSE;

/**
* @param PHPUnit_Runner_TestSuiteLoader $loader
* @param PHP_CodeCoverage_Filter $filter
* @param null|PHPUnit_Runner_TestSuiteLoader $loader
* @param null|PHP_CodeCoverage_Filter $filter
* @since Method available since Release 3.4.0
*/
public function __construct(PHPUnit_Runner_TestSuiteLoader $loader = NULL, PHP_CodeCoverage_Filter $filter = NULL)
public function __construct($loader = NULL, $filter = NULL)
{
Types::isNullable('loader', $loader, 'PHPUnit_Runner_TestSuiteLoader');
Types::isNullable('filter', $filter, 'PHP_CodeCoverage_Filter');

if ($filter === NULL) {
$filter = new PHP_CodeCoverage_Filter;
}
Expand Down
12 changes: 9 additions & 3 deletions PHPUnit/Util/PHP.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Zf1s\Compat\Types;

/**
* PHPUnit
*
Expand Down Expand Up @@ -154,13 +157,16 @@ public static function factory()
* Runs a single job (PHP code) using a separate PHP process.
*
* @param string $job
* @param PHPUnit_Framework_TestCase $test
* @param PHPUnit_Framework_TestResult $result
* @param PHPUnit_Framework_TestCase|null $test
* @param PHPUnit_Framework_TestResult|null $result
* @return array|null
* @throws PHPUnit_Framework_Exception
*/
public function runJob($job, PHPUnit_Framework_Test $test = NULL, PHPUnit_Framework_TestResult $result = NULL)
public function runJob($job, $test = NULL, $result = NULL)
{
Types::isNullable('test', $test, 'PHPUnit_Framework_Test');
Types::isNullable('result', $result, 'PHPUnit_Framework_TestResult');

$process = proc_open(
$this->getPhpBinary(),
array(
Expand Down
7 changes: 6 additions & 1 deletion Tests/_files/DoubleTestCase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Zf1s\Compat\Types;

class DoubleTestCase implements PHPUnit_Framework_Test
{
protected $testCase;
Expand All @@ -14,8 +17,10 @@ public function count()
return 2;
}

public function run(PHPUnit_Framework_TestResult $result = NULL)
public function run($result = NULL)
{
Types::isNullable('result', $result, 'PHPUnit_Framework_TestResult');

$result->startTest($this);

$this->testCase->runBare();
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
{
"type": "pear",
"url": "https://pear.php.net"
},
{
"type": "git",
"url": "[email protected]:zf1s/compat.git"
}
],
"require": {
Expand All @@ -44,7 +48,8 @@
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*"
"ext-spl": "*",
"zf1s/compat": "^1.0"
},
"require-dev": {
"pear-pear.php.net/pear": "~1.9|~1.10"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Zf1s\Compat\Types;

/**
* PHPUnit
*
Expand Down Expand Up @@ -376,8 +379,10 @@ public static function getObjectForTrait($traitName, array $arguments = array(),
* @param boolean $cloneArguments
* @return array
*/
public static function generate($originalClassName, array $methods = NULL, $mockClassName = '', $callOriginalClone = TRUE, $callAutoload = TRUE, $cloneArguments = TRUE)
public static function generate($originalClassName, $methods = NULL, $mockClassName = '', $callOriginalClone = TRUE, $callAutoload = TRUE, $cloneArguments = TRUE)
{
Types::isNullable('methods', $methods, 'array');

if ($mockClassName == '') {
$key = md5(
$originalClassName .
Expand Down
Loading