Example #1
0
 /**
  * Test that validates the talk type
  *
  * @test
  * @dataProvider typeProvider
  * @param string  $type
  * @param boolean $expectedResponse
  */
 public function typeValidatesCorrectly($type, $expectedResponse)
 {
     $data = ['type' => $type];
     $form = new \OpenCFP\Http\Form\TalkForm($data, $this->purifier);
     $form->sanitize();
     $this->assertEquals($expectedResponse, $form->validateType(), '\\OpenCFP\\Form\\TalkForm::validateType() did not apply validation rules correctly');
 }
Example #2
0
 /**
  * Test that validates the talk type
  *
  * @test
  * @dataProvider levelProvider
  * @param string  $level
  * @param boolean $expectedResponse
  */
 public function levelValidatesCorrectly($level, $expectedResponse)
 {
     $data = ['level' => $level];
     $form = new \OpenCFP\Http\Form\TalkForm($data, $this->purifier, ['levels' => ['entry' => 'Entry', 'advanced' => 'Advanced']]);
     $form->sanitize();
     $this->assertEquals($expectedResponse, $form->validateLevel(), '\\OpenCFP\\Form\\TalkForm::validateType() did not apply validation rules correctly');
 }