/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage When changing a name you need to pass either a string, an array or a Name node */ public function testInvalidArg() { $name = new Name('foo'); $name->set(new \stdClass()); }