Exemplo n.º 1
0
 /**
  * Assert that two values equal
  *
  * @param mixed $expected Expected value
  * @param mixed $actual Actual value
  * @return boolean Actual value equals the expected one
  */
 protected function assertEquals($expected, $actual)
 {
     // If both values don't have the same type
     if (gettype($expected) !== gettype($actual)) {
         return false;
     }
     // If we are comparing arrays
     if (is_array($expected)) {
         return ArrayUtility::reduce($expected) == ArrayUtility::reduce($actual);
     }
     // Compare the values
     return $expected == $actual;
 }
Exemplo n.º 2
0
 /**
  * Return the URL query parameters as list
  *
  * @return array URL query parameters
  */
 public function getQueryParams()
 {
     $query = [];
     if (isset($this->urlParts['query']) && !empty($this->urlParts['query'])) {
         parse_str($this->urlParts['query'], $query);
     }
     return ArrayUtility::sortRecursiveByKey((array) $query);
 }