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