����JFIF��x�x����'
Server IP : 78.140.185.180 / Your IP : 216.73.216.150 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/builderbox/www/vendor/guzzle/guzzle/tests/Guzzle/Tests/Common/ |
Upload File : |
<?php namespace Guzzle\Tests\Common; use Guzzle\Common\Event; use Guzzle\Common\AbstractHasDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher; /** * @covers Guzzle\Common\AbstractHasDispatcher */ class AbstractHasAdapterTest extends \Guzzle\Tests\GuzzleTestCase { public function testDoesNotRequireRegisteredEvents() { $this->assertEquals(array(), AbstractHasDispatcher::getAllEvents()); } public function testAllowsDispatcherToBeInjected() { $d = new EventDispatcher(); $mock = $this->getMockForAbstractClass('Guzzle\Common\AbstractHasDispatcher'); $this->assertSame($mock, $mock->setEventDispatcher($d)); $this->assertSame($d, $mock->getEventDispatcher()); } public function testCreatesDefaultEventDispatcherIfNeeded() { $mock = $this->getMockForAbstractClass('Guzzle\Common\AbstractHasDispatcher'); $this->assertInstanceOf('Symfony\Component\EventDispatcher\EventDispatcher', $mock->getEventDispatcher()); } public function testHelperDispatchesEvents() { $data = array(); $mock = $this->getMockForAbstractClass('Guzzle\Common\AbstractHasDispatcher'); $mock->getEventDispatcher()->addListener('test', function(Event $e) use (&$data) { $data = $e->getIterator()->getArrayCopy(); }); $mock->dispatch('test', array( 'param' => 'abc' )); $this->assertEquals(array( 'param' => 'abc', ), $data); } public function testHelperAttachesSubscribers() { $mock = $this->getMockForAbstractClass('Guzzle\Common\AbstractHasDispatcher'); $subscriber = $this->getMockForAbstractClass('Symfony\Component\EventDispatcher\EventSubscriberInterface'); $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') ->setMethods(array('addSubscriber')) ->getMock(); $dispatcher->expects($this->once()) ->method('addSubscriber'); $mock->setEventDispatcher($dispatcher); $mock->addSubscriber($subscriber); } }