Skip to content

Commit a3cb7fb

Browse files
committed
Use public API of php-mock
PHPProphet::checkPredictions() used an implementation detail of php-mock. This might change at any time and break here. This commit uses the same functionality through the public API.
1 parent 22cbd5b commit a3cb7fb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

classes/PHPProphet.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace phpmock\prophecy;
44

5-
use phpmock\MockRegistry;
5+
use phpmock\Mock;
66
use phpmock\MockBuilder;
77
use Prophecy\Prophet;
88
use Prophecy\Prophecy\ProphecyInterface;
@@ -73,10 +73,11 @@ public function prophesize($namespace)
7373
* It will also disable all previously revealed function prophecies.
7474
*
7575
* @throws AggregateException If any prediction fails.
76+
* @SuppressWarnings(PHPMD)
7677
*/
7778
public function checkPredictions()
7879
{
79-
MockRegistry::getInstance()->unregisterAll();
80+
Mock::disableAll();
8081
$this->prophet->checkPredictions();
8182
}
8283

0 commit comments

Comments
 (0)