1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 02:22:57 +01:00
guzzle/tests/Event/AbstractRequestEventTest.php
Michael Dowling 668209c895 Getting tests working again. Removing more fluent interfaces.
Removing more fluent interfaces to make it easier to decorate
classes.
2014-09-08 21:35:11 -07:00

34 lines
1.0 KiB
PHP

<?php
namespace GuzzleHttp\Tests\Event;
use GuzzleHttp\Client;
use GuzzleHttp\Transaction;
use GuzzleHttp\Message\Request;
/**
* @covers GuzzleHttp\Event\AbstractRequestEvent
*/
class AbstractRequestEventTest extends \PHPUnit_Framework_TestCase
{
public function testHasTransactionMethods()
{
$t = new Transaction(new Client(), new Request('GET', '/'));
$e = $this->getMockBuilder('GuzzleHttp\Event\AbstractRequestEvent')
->setConstructorArgs([$t])
->getMockForAbstractClass();
$this->assertSame($t->client, $e->getClient());
$this->assertSame($t->request, $e->getRequest());
}
public function testHasTransaction()
{
$t = new Transaction(new Client(), new Request('GET', '/'));
$e = $this->getMockBuilder('GuzzleHttp\Event\AbstractRequestEvent')
->setConstructorArgs([$t])
->getMockForAbstractClass();
$r = new \ReflectionMethod($e, 'getTransaction');
$r->setAccessible(true);
$this->assertSame($t, $r->invoke($e));
}
}