Пример #1
0
 public function testMagic()
 {
     // Test data
     $params = array('page' => 2, 'per_page' => 10, 'num' => 1);
     // Create the request
     $request = new Request($params);
     // Test Exists
     $this->assertTrue(isset($request->per_page));
     // Test Getter
     $this->assertSame($params['per_page'], $request->per_page);
     // Test Setter
     $this->assertSame($request->test = '#yup', $request->param('test'));
     // Test Unsetter
     unset($request->test);
     $this->assertNull($request->param('test'));
 }
 /**
  * Start a validator chain for the specified parameter
  *
  * @param string $param     The name of the parameter to validate
  * @param string $err       The custom exception message to throw
  * @access public
  * @return Validator
  */
 public function validateParam($param, $err = null)
 {
     return $this->validate($this->request->param($param), $err);
 }