Esempio n. 1
0
 public function testReturnCorrectValueWhenNotInitiated()
 {
     $active = new Active(null);
     $this->assertFalse($active->checkAction([]));
     $this->assertFalse($active->checkRouteParam('', ''));
     $this->assertFalse($active->checkRoute([]));
     $this->assertFalse($active->checkRoutePattern([]));
     $this->assertFalse($active->checkUriPattern([]));
     $this->assertFalse($active->checkUri([]));
     $this->assertFalse($active->checkQuery('', ''));
     $this->assertFalse($active->checkController([]));
     $this->assertSame('', $active->getAction());
     $this->assertSame('', $active->getController());
     $this->assertSame('', $active->getMethod());
 }
Esempio n. 2
0
 /**
  * Check if one of the following condition is true:
  * + the value of $value is `false` and the current querystring contain the key $key
  * + the value of $value is not `false` and the current value of the $key key in the querystring equals to $value
  * + the value of $value is not `false` and the current value of the $key key in the querystring is an array that
  * contains the $value
  *
  * @param string $key
  * @param mixed $value
  * @return bool 
  * @static 
  */
 public static function checkQuery($key, $value)
 {
     return \HieuLe\Active\Active::checkQuery($key, $value);
 }