/** * Test that form object correctly detects if all the required fields * are in the user-submitted data * * @test * @dataProvider hasRequiredProvider * @param array $rawData serialized user-submitted data * @param boolean $response */ public function correctlyDetectsRequiredFields($rawData, $response) { $data = unserialize($rawData); $form = new \OpenCFP\Http\Form\TalkForm($data, $this->purifier); $this->assertEquals($response, $form->hasRequiredFields(), '\\OpenCFP\\Form\\TalkForm::hasRequired() did not work correctly'); }
/** * Test that form object correctly detects if all the required fields * are in the user-submitted data * * @test * @dataProvider hasNoDesiredOrSponsorProvider * @param array $rawData serialized user-submitted data * @param boolean $response */ public function submitsTalkWhenNoDesiredOrSponrosIncluded($rawData, $response) { $data = unserialize($rawData); $form = new \OpenCFP\Http\Form\TalkForm($data, $this->purifier); $this->assertEquals($response, $form->hasRequiredFields(), '\\OpenCFP\\Form\\TalkForm::hasRequired() did not work correctly'); }