Skip to content

Commit d171a2e

Browse files
committed
Deprecate CreateTargetTrait
Since phpscpec/Prophecy does not allow partial mocking, this trait was useless. You can use CreateProphecyTrait instead to create more general prophecies.
1 parent c4de42b commit d171a2e

2 files changed

Lines changed: 6 additions & 146 deletions

File tree

src/TestCase/CreateTargetTrait.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* @method ObjectProphecy prophesize(string $classOrInterface)
1919
*
2020
* @author Mathias Gelhausen <gelhausen@cross-solution.de>
21+
* @deprecated Prophecy does not allow partial mocking. Use CreateProphecyTrait instead
22+
* @codeCoverageIgnore
2123
*/
2224
trait CreateTargetTrait
2325
{
@@ -29,6 +31,7 @@ trait CreateTargetTrait
2931
* @param array ...$args
3032
*
3133
* @return object
34+
* @deprecated
3235
*/
3336
public function createTarget(string $class, ...$args): object
3437
{
@@ -41,6 +44,7 @@ public function createTarget(string $class, ...$args): object
4144
* @param object|string $class
4245
*
4346
* @return \ReflectionClass
47+
* @deprecated
4448
*/
4549
public function createTargetReflection($class): \ReflectionClass
4650
{
@@ -79,6 +83,7 @@ public function createTargetReflection($class): \ReflectionClass
7983
* @param array $prophecies
8084
*
8185
* @return ObjectProphecy
86+
* @deprecated
8287
*/
8388
public function createTargetProphecy($class, array $prophecies = []): ObjectProphecy
8489
{
@@ -127,6 +132,7 @@ public function createTargetProphecy($class, array $prophecies = []): ObjectProp
127132
* @param array $prophecies
128133
*
129134
* @return object
135+
* @deprecated
130136
*/
131137
public function createTargetDouble($class, array $prophecies = []): object
132138
{

test/TestUtilsTest/TestCase/CreateTargetTraitTest.php

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

0 commit comments

Comments
 (0)