Skip to content

Commit 9aaae99

Browse files
committed
Drop support for pass-by-reference
Supporting pass-by-reference was such a hack and now side effects of that hack were reported. Upstream won't support pass-by-reference anyways, so I'm going to drop that here as well. If you need to mock a function which uses pass-by-reference (e.g. exec()) feel free to use another testing framework (e.g. phpunit with php-mock-phpunit). See also: #1, phpspec/prophecy#225
1 parent de2ef15 commit 9aaae99

File tree

4 files changed

+11
-124
lines changed

4 files changed

+11
-124
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ This library comes with the same restrictions as the underlying
5151

5252
* Additionally it shares restrictions from Prophecy as well:
5353
Prophecy [doesn't support pass-by-reference](https://github.com/phpspec/prophecy/issues/225).
54-
To support pass-by-reference here, an
55-
[implicit feature of composer](https://github.com/composer/composer/issues/4732)
56-
is used. It may work accidentially but can change at any moment.
5754
If you need pass-by-reference in prophecies, consider using another framework
5855
(e.g. [php-mock-phpunit](https://github.com/php-mock/php-mock-phpunit)).
5956

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
],
1616
"autoload": {
1717
"psr-4": {
18-
"phpmock\\prophecy\\": "classes/",
19-
"Prophecy\\": "overwrites/Prophecy/"
18+
"phpmock\\prophecy\\": "classes/"
2019
}
2120
},
2221
"require": {

overwrites/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php

Lines changed: 0 additions & 119 deletions
This file was deleted.

tests/PHPProphetTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,14 @@ public function testBackupStaticAttributes()
5656
{
5757
$this->markTestSkipped("Skip until PHPUnit#2016 is resolved");
5858
}
59+
60+
/**
61+
* Pass-By-Reference is not supported in Prophecy.
62+
*
63+
* @see https://github.com/phpspec/prophecy/issues/225
64+
*/
65+
public function testPassingByReference()
66+
{
67+
$this->markTestSkipped("Pass-By-Reference is not supported in Prophecy");
68+
}
5969
}

0 commit comments

Comments
 (0)