/** * @covers PersonController::Add * @todo Implement testAdd(). */ public function testAdd() { $request = Application::getInstance()->request; $request->setParams(array('name' => 'Louise the Zero', 'type' => 'adult')); $res = $this->object->add(); $this->assertTrue(isset($res['id'])); $request->setParams(array('name' => 'Louise the Zero', 'type' => 'OLOLOLO LOLO LOLO')); $res = $this->object->add(); $this->assertTrue(isset($res['error'])); $request->setParams(array('name' => '', 'type' => '')); $res = $this->object->add(); $this->assertTrue(isset($res['error'])); $request->setParams(array('name' => 'Tristana', 'type' => 'veteran')); $res = $this->object->add(); $this->assertTrue(isset($res['id'])); }