public function case_send() { $self = $this; $this->given($eventId = 'hoa://Event/Test', $source = new \Mock\Hoa\Event\Source(), LUT::register($eventId, $source), $bucket = new SUT('foo'), LUT::getEvent($eventId)->attach(function (SUT $receivedBucket) use($self, $bucket, &$called) { $called = true; $self->object($receivedBucket)->isIdenticalTo($bucket); }))->when($result = $bucket->send($eventId, $source))->then->variable($result)->isNull()->boolean($called)->isTrue(); }
public function case_event_is_sent() { $self = $this; $this->given(Event::getEvent('hoa://Event/Exception')->attach(function (Event\Bucket $bucket) use($self, &$called) { $called = true; $self->object($bucket->getSource())->isInstanceOf('Hoa\\Exception\\Exception')->string($bucket->getSource()->getMessage())->isEqualTo('foo')->object($bucket->getData())->isIdenticalTo($bucket->getSource()); }))->when(new SUT('foo'))->then->boolean($called)->isTrue(); }
throw new Exception('Selector %s is not a valid selector.', 22, $selector); } /** * Destruct XYL object. * * @return void */ public function __destruct() { $protocol = Protocol::getInstance(); unset($protocol['Library']['Xyl[' . $this->_i . ']']); return; } } /** * Class \Hoa\Xyl\_Protocol. * * The `hoa://Library/Xyl` node. * * @copyright Copyright © 2007-2016 Hoa community * @license New BSD License */ class _Protocol extends Protocol\Node { } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Xyl\\Xyl'); Event::getEvent('hoa://Event/Exception')->attach(xcallable('Hoa\\Xyl\\Interpreter\\Common\\Debug', 'receiveException'));