/** * @param string $name the message name * @param null|object $sender the sender object * @param array $parameters the parameters to add to the message * @throws \InvalidArgumentException */ public function __construct($name, $sender = null, array $parameters = []) { Assert::isString($name); if ($sender !== null) { Assert::isObject($sender); } $this->name = $name; $this->sender = $sender; $this->params = $parameters; $this->stopped = false; $this->responseList = new ArrayList(); }
/** * @covers Brickoo\Component\Common\Assert::isObject * @expectedException \InvalidArgumentException */ public function testIsObjectThrowsArgumentException() { Assert::isObject(array("wrongType")); }