Commit ac83c78f authored by Simon Welsh's avatar Simon Welsh

Updates to current PHPUnit 5.6 state

Depreacates a couple of methods, adds a new one and a couple of tests.
parent 9003a107
Pipeline #160 passed with stages
in 1 minute and 37 seconds
......@@ -5,6 +5,11 @@
* Updated to match PHPUnit 5.6
* Added:
+ `PHPUnit_Framework_TestCase::createConfiguredMock`
+ `PHPUnit_Framework_TestCase::doesNotPerformAssertions`
* Deprecated:
+ `PHPUnit_Framework_TestCase::hasPerformedExpectationsOnOutput`
+ `PHPUnit_Framework_TestCase::setExpectedException`
+ `PHPUnit_Framework_TestCase::setExpectedExceptionRegExp`
## 5.5.0
......
......@@ -64,16 +64,16 @@
},
{
"name": "myclabs/deep-copy",
"version": "1.5.1",
"version": "1.5.4",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "a8773992b362b58498eed24bf85005f363c34771"
"reference": "ea74994a3dc7f8d2f65a06009348f2d63c81e61f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771",
"reference": "a8773992b362b58498eed24bf85005f363c34771",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/ea74994a3dc7f8d2f65a06009348f2d63c81e61f",
"reference": "ea74994a3dc7f8d2f65a06009348f2d63c81e61f",
"shasum": ""
},
"require": {
......@@ -102,7 +102,7 @@
"object",
"object graph"
],
"time": "2015-11-20 12:04:31"
"time": "2016-09-16 13:37:59"
},
{
"name": "phpdocumentor/reflection-common",
......@@ -558,24 +558,24 @@
},
{
"name": "phpunit/phpunit",
"version": "dev-master",
"version": "5.7.x-dev",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "467d048f06b50afe9b0de3a2855a7bd53b4aa63c"
"reference": "c2ad965fb0416aeb1e6bec481c054e1d8a5cf17c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/467d048f06b50afe9b0de3a2855a7bd53b4aa63c",
"reference": "467d048f06b50afe9b0de3a2855a7bd53b4aa63c",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c2ad965fb0416aeb1e6bec481c054e1d8a5cf17c",
"reference": "c2ad965fb0416aeb1e6bec481c054e1d8a5cf17c",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"myclabs/deep-copy": "~1.3",
"php": "^5.6 || ^7.0",
"phpspec/prophecy": "^1.3.1",
......@@ -597,7 +597,11 @@
"conflict": {
"phpdocumentor/reflection-docblock": "3.0.2"
},
"require-dev": {
"ext-pdo": "*"
},
"suggest": {
"ext-xdebug": "*",
"phpunit/php-invoker": "~1.1"
},
"bin": [
......@@ -606,7 +610,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.6.x-dev"
"dev-master": "5.7.x-dev"
}
},
"autoload": {
......@@ -632,20 +636,20 @@
"testing",
"xunit"
],
"time": "2016-08-11 15:54:32"
"time": "2016-09-08 05:22:30"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "3.2.3",
"version": "3.2.7",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "b13d0d9426ced06958bd32104653526a6c998a52"
"reference": "546898a2c0c356ef2891b39dd7d07f5d82c8ed0a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b13d0d9426ced06958bd32104653526a6c998a52",
"reference": "b13d0d9426ced06958bd32104653526a6c998a52",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/546898a2c0c356ef2891b39dd7d07f5d82c8ed0a",
"reference": "546898a2c0c356ef2891b39dd7d07f5d82c8ed0a",
"shasum": ""
},
"require": {
......@@ -691,7 +695,7 @@
"mock",
"xunit"
],
"time": "2016-06-12 07:37:26"
"time": "2016-09-06 16:07:45"
},
{
"name": "sebastian/code-unit-reverse-lookup",
......@@ -856,23 +860,23 @@
},
{
"name": "sebastian/environment",
"version": "1.3.7",
"version": "1.3.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716"
"reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716",
"reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea",
"reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": "^5.3.3 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
"phpunit/phpunit": "^4.8 || ^5.0"
},
"type": "library",
"extra": {
......@@ -902,7 +906,7 @@
"environment",
"hhvm"
],
"time": "2016-05-17 03:18:57"
"time": "2016-08-18 05:49:44"
},
{
"name": "sebastian/exporter",
......@@ -1208,16 +1212,16 @@
},
{
"name": "symfony/yaml",
"version": "v3.1.3",
"version": "v3.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "1819adf2066880c7967df7180f4f662b6f0567ac"
"reference": "f291ed25eb1435bddbe8a96caaef16469c2a092d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/1819adf2066880c7967df7180f4f662b6f0567ac",
"reference": "1819adf2066880c7967df7180f4f662b6f0567ac",
"url": "https://api.github.com/repos/symfony/yaml/zipball/f291ed25eb1435bddbe8a96caaef16469c2a092d",
"reference": "f291ed25eb1435bddbe8a96caaef16469c2a092d",
"shasum": ""
},
"require": {
......@@ -1253,7 +1257,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2016-07-17 14:02:08"
"time": "2016-09-02 02:12:52"
},
{
"name": "webmozart/assert",
......
......@@ -23,6 +23,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert
protected function checkRequirements(): void;
protected function createResult(): PHPUnit_Framework_TestResult;
public function dataDescription(): string;
public function doesNotPerformAssertions(): bool;
public function expectOutputRegex(?string $expectedRegex): void;
public function expectOutputString(?string $expectedString): void;
public function getActualOutput(): string;
......@@ -47,6 +48,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert
public function hasFailed(): bool;
public function hasOutput(): bool;
public function hasSize(): bool;
<<__Deprecated('Use hasExpectationOnOutput() instead')>>
public function hasPerformedExpectationsOnOutput(): bool;
protected function iniSet(string $varName, string $newValue): void;
public function isInIsolation(): bool;
......@@ -69,11 +71,19 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert
public function setBeStrictAboutChangesToGlobalState(
bool $beStrictAboutChangeToGlobalState,
): void;
<<
__Deprecated('Use expectException() and expectExceptionMessage() instead')
>>
public function setExpectedException<T>(
?classname<T> $name,
?string $message = '',
?arraykey $code = null,
): void;
<<
__Deprecated(
'Use expectException() and expectExceptionMessageRegExp() instead',
)
>>
public function setExpectedExceptionRegExp<T>(
?classname<T> $name,
string $messageRegExp = '',
......@@ -120,7 +130,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert
protected function createConfiguredMock<T>(
classname<T> $originalClassName,
array $configuration,
)/*: PHPUnit_Framework_MockObject_MockObject*/;
) /*: PHPUnit_Framework_MockObject_MockObject*/;
protected function createPartialMock<T>(
classname<T> $originalClassName,
array $methods,
......
......@@ -13,4 +13,18 @@ class TestCaseTest extends HHITest {
'testcase/deprecated/getMockWithoutInvokingTheOriginalConstructor',
);
}
public function testDeprecatedHasPerformedExpectationsOnOutput(): void {
$this->runTestFile(
'testcase/deprecated/hasPerformedExpectationsOnOutput',
);
}
public function testDeprecatedSetExpectedException(): void {
$this->runTestFile('testcase/deprecated/setExpectedException');
}
public function testDeprecatedSetExpectedExceptionRegExp(): void {
$this->runTestFile('testcase/deprecated/setExpectedExceptionRegExp');
}
}
......@@ -8,7 +8,7 @@ class PHPUnit_Hhi_Test extends PHPUnit_Framework_TestCase {
$this->assertFalse(false, 0);
$this->assertFalse(false, false);
$this->assertFalse(false, 4.3);
$this->assertFalse(false, []);
$this->assertFalse(false, [1]);
$this->assertFalse(false, $this);
$this->assertFalse(false, null);
}
......@@ -19,7 +19,7 @@ class PHPUnit_Hhi_Test extends PHPUnit_Framework_TestCase {
$this->assertTrue(false, 0);
$this->assertTrue(false, false);
$this->assertTrue(false, 4.3);
$this->assertTrue(false, []);
$this->assertTrue(false, [1]);
$this->assertTrue(false, $this);
$this->assertTrue(false, null);
}
......@@ -30,12 +30,12 @@ class PHPUnit_Hhi_Test extends PHPUnit_Framework_TestCase {
7:4110:Invalid argument. This is a string. It is incompatible with an int.
8:4110:Invalid argument. This is a string. It is incompatible with a bool.
9:4110:Invalid argument. This is a string. It is incompatible with a float.
10:4110:Invalid argument. This is a string. It is incompatible with an array.
10:4110:Invalid argument. This is a string. It is incompatible with an array (used like a vector).
11:4110:Invalid argument. This is a string. It is incompatible with an object of type PHPUnit_Hhi_Test.
12:4110:Invalid argument. This is a string. It is incompatible with a nullable type.
18:4110:Invalid argument. This is a string. It is incompatible with an int.
19:4110:Invalid argument. This is a string. It is incompatible with a bool.
20:4110:Invalid argument. This is a string. It is incompatible with a float.
21:4110:Invalid argument. This is a string. It is incompatible with an array.
21:4110:Invalid argument. This is a string. It is incompatible with an array (used like a vector).
22:4110:Invalid argument. This is a string. It is incompatible with an object of type PHPUnit_Hhi_Test.
23:4110:Invalid argument. This is a string. It is incompatible with a nullable type.
---FILE---
<?hh // strict
class PHPUnit_Hhi_Test extends PHPUnit_Framework_TestCase {
public function testHasPerformedExpectationsOnOutput(): void {
$this->hasPerformedExpectationsOnOutput();
}
}
---PASS---
0
---ERRORS---
5:4128:The method hasPerformedExpectationsOnOutput is deprecated: Use hasExpectationOnOutput() instead. Definition is here.
---FILE---
<?hh // strict
class PHPUnit_Hhi_Test extends PHPUnit_Framework_TestCase {
public function testSetExpectedException(): void {
$this->setExpectedException(self::class, 'n');
}
}
---PASS---
0
---ERRORS---
5:4128:The method setExpectedException is deprecated: Use expectException() and expectExceptionMessage() instead. Definition is here.
---FILE---
<?hh // strict
class PHPUnit_Hhi_Test extends PHPUnit_Framework_TestCase {
public function testSetExpectedExceptionRegExp(): void {
$this->setExpectedExceptionRegExp(self::class, 'n');
}
}
---PASS---
0
---ERRORS---
5:4128:The method setExpectedExceptionRegExp is deprecated: Use expectException() and expectExceptionMessageRegExp() instead. Definition is here.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment