rcrowe\Hippy\Client::setTransport PHP Méthode

setTransport() public méthode

Set the instance of TransportInterface that will actually send the message.
public setTransport ( rcrowe\Hippy\Transport\TransportInterface $transport ) : void
$transport rcrowe\Hippy\Transport\TransportInterface
Résultat void
    public function setTransport(TransportInterface $transport)
    {
        $this->transport = $transport;
    }

Usage Example

Exemple #1
0
 public function testTransport()
 {
     $transport = new Transport(null, null, null);
     $hippy = new Hippy($transport);
     $this->assertEquals(get_class($hippy->getTransport()), 'rcrowe\\Hippy\\Transport\\Guzzle');
     $transport = new Transport(null, null, null);
     $transport->helloWorld = 'egg';
     $hippy = new Hippy($transport);
     $hippy->setTransport($transport);
     $this->assertEquals($hippy->getTransport()->helloWorld, 'egg');
 }