Sets the arguments for the request.
public setArguments ( array $arguments ) : Phergie_Event_Request | ||
$arguments | array | Request arguments |
Результат | Phergie_Event_Request | Provides a fluent interface |
/** * Tests that the event makes virtual "getter" methods available based * on the parameters associated with the event type. * * @param string $type Event type corresponding to the arguments for * which to test virtual "getter" methods * @param array $args Associative array mapping argument name to its * position starting from 0 * * @return void * @dataProvider dataProviderTestProvidesVirtualGetterMethods */ public function testProvidesVirtualGetterMethods($type, array $args) { $this->event->setType($type); $this->event->setArguments(array_keys($args)); foreach ($args as $name => $position) { $this->assertSame($name, $this->event->{'get' . ucfirst($name)}()); } }
/** * Tests that the event makes virtual "getter" methods available based * on the parameters associated with the event type. * * @return void */ public function testProvidesVirtualGetterMethods() { $receiver = '#channel'; $text = 'text'; $this->event->setType('privmsg'); $this->event->setArguments(array($receiver, $text)); $this->assertSame($receiver, $this->event->getReceiver()); $this->assertSame($text, $this->event->getText()); }