public function add(PersonEntity $personEntity) { $newId = max(array_keys($this->people)) + 1; $personEntity->setId($newId); $this->setPeople($this->getPeople() + array($newId => $personEntity)); $this->save(); return $personEntity->getId(); }
/** * @depends testInstance * @dataProvider notInts * @expectedException \Exception * @expectedExceptionMessage Person ID must be an integer */ public function testInvalidSetId($id) { $this->instance->setId($id); }