X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2FDiceHttpMockHandlerTrait.php;h=56250817d64a5bf6d64facfee277c6b0014d6f9a;hb=f879b2c9bce17350c11a128052f32eea10039401;hp=969b76b5b005f94d181aed174546756b2564226c;hpb=cf0b7b709b1a9a5d64b261817fd02b9812d7fd04;p=friendica.git diff --git a/tests/DiceHttpMockHandlerTrait.php b/tests/DiceHttpMockHandlerTrait.php index 969b76b5b0..56250817d6 100644 --- a/tests/DiceHttpMockHandlerTrait.php +++ b/tests/DiceHttpMockHandlerTrait.php @@ -1,6 +1,6 @@ httpRequestHandler) && $this->httpRequestHandler instanceof HandlerStack) { - return; - } + $this->setUpFixtures(); $this->httpRequestHandler = HandlerStack::create(); $dice = DI::getDice(); // addRule() clones the current instance and returns a new one, so no concurrency problems :-) - $newDice = $dice->addRule(IHTTPClient::class, [ - 'instanceOf' => HTTPClientFactory::class, + $newDice = $dice->addRule(ICanSendHttpRequests::class, [ + 'instanceOf' => HttpClient::class, 'call' => [ ['createClient', [$this->httpRequestHandler], Dice::CHAIN_CALL], ], @@ -59,10 +59,8 @@ trait DiceHttpMockHandlerTrait DI::init($newDice); } - protected function tearDown(): void + protected function tearDownHandler(): void { - \Mockery::close(); - - parent::tearDown(); + $this->tearDownFixtures(); } }