Kraken\_Unit\Channel\Extra\RequestTest::testApiSend_TriesToRetryOnCancel PHP Method

testApiSend_TriesToRetryOnCancel() public method

    public function testApiSend_TriesToRetryOnCancel()
    {
        $req = $this->createRequest($name = 'name', $mssg = 'secret', [], ['retryOrReset']);
        $channel = $this->getProtectedProperty($req, 'channel');
        $channel->expects($this->once())->method('send')->will($this->returnCallback(function ($name, $message, $mode, $success, $failure, $abort, $timeout) {
            $abort('exception');
        }));
        $promise = new Promise();
        $req->expects($this->once())->method('retryOrReset')->will($this->returnCallback(function ($result, $ex) use($promise) {
            $this->assertSame($promise, $result);
            $this->assertSame('exception', $ex);
        }));
        $this->callProtectedMethod($req, 'send', [$promise]);
    }