Example #1
0
 public function testIsPostParamValid()
 {
     $validator = $this->getBasicMock('horses\\Validator');
     $validator->expects($this->any())->method('isValid')->will($this->returnCallback(function ($key) {
         return $key == 'pff';
     }));
     $this->assertTrue($this->request->isPostParamValid('greu', $validator));
     $this->assertFalse($this->request->isPostParamValid('another', $validator));
     $this->assertFalse($this->request->isGetParamValid('unknown', $validator));
 }