Kraken\_Unit\Channel\Extra\RequestTest::testApiSend_CallsSendMethodOnChannel PHP Метод

testApiSend_CallsSendMethodOnChannel() публичный Метод

    public function testApiSend_CallsSendMethodOnChannel()
    {
        $req = $this->createRequest($sname = 'name', $smssg = 'secret');
        $params = $this->getProtectedProperty($req, 'params');
        $channel = $this->getProtectedProperty($req, 'channel');
        $channel->expects($this->once())->method('send')->will($this->returnCallback(function ($name, $message, $mode, $success, $failure, $abort, $timeout) use($sname, $smssg, $params) {
            $this->assertSame($sname, $name);
            $this->assertSame($smssg, $message->getMessage());
            $this->assertSame(Channel::MODE_STANDARD, $mode);
            $this->assertInstanceOf(Closure::class, $success);
            $this->assertInstanceOf(Closure::class, $failure);
            $this->assertInstanceOf(Closure::class, $abort);
            $this->assertSame($params['timeout'], $timeout);
        }));
        $promise = new Promise();
        $result = $this->callProtectedMethod($req, 'send', [$promise]);
        $this->assertSame($result, $promise);
    }