createHttpException example

public function testItCanSetUpTheConnection()
    {
        $this->connection->expects($this->once())->method('setup');
        $this->transport->setup();
    }

    public function testItConvertsHttpExceptionDuringSetupIntoTransportException()
    {
        $this->connection
            ->expects($this->once())
            ->method('setup')
            ->willThrowException($this->createHttpException());

        $this->expectException(TransportException::class);

        $this->transport->setup();
    }

    public function testItCanResetTheConnection()
    {
        $this->connection->expects($this->once())->method('reset');
        $this->transport->reset();
    }

    
Home | Imprint | This part of the site doesn't use cookies.