mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-25 02:22:57 +01:00
- Moving various namespaces up a level - Updating docs - Renaming EventSubscriberInterface to SubscriberInterface
35 lines
1.1 KiB
PHP
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));
|
|
}
|
|
}
|