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 89a8e2ede1 Using PSR-4 and moving namespace from Guzzle to GuzzleHttp
- Moving various namespaces up a level
- Updating docs
- Renaming EventSubscriberInterface to SubscriberInterface
2014-02-16 20:42:45 -08:00

35 lines
1.1 KiB
PHP

<?php
namespace GuzzleHttp\Tests\Event;
use GuzzleHttp\Client;
use GuzzleHttp\Adapter\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->getClient(), $e->getClient());
$this->assertSame($t->getRequest(), $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));
}
}