/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Value is not an instance of Category */ public function testAddInvalidCategoryShouldThrowInvalidArgumentException() { $collection = new CategoryCollection(); $collection->add(1); }