diff --git a/tests/Stub/MockQuery.php b/tests/Stub/MockQuery.php new file mode 100644 index 0000000..c6fecdb --- /dev/null +++ b/tests/Stub/MockQuery.php @@ -0,0 +1,78 @@ +params[$name]; + } + + /** + * Add a new parameter + * + * @param string $name + * @param mixed $value + * + * @return mixed + */ + public function set ($name, $value) + { + // TODO: Implement set() method. + } + + /** + * Check if a parameter exists + * + * @param string $name + * + * @return mixed + */ + public function has ($name) {} + + /** + * Remove a parameter + * + * @param string $name + */ + public function remove ($name) {} + + /** + * Import a new set parameters. The new parameters should be + * appended to the current list and not replacing one for the other. + * + * @param array $parameters + * + * @return mixed + */ + public function import (array $parameters) + { + $this->params = $parameters; + + return $this; + } + + public function __toString () + { + return http_build_query($this->params); + } +} \ No newline at end of file diff --git a/tests/Stub/MockUrl.php b/tests/Stub/MockUrl.php new file mode 100644 index 0000000..d67eb3a --- /dev/null +++ b/tests/Stub/MockUrl.php @@ -0,0 +1,165 @@ +scheme = $scheme; + $this->path = $path; + $this->host = $host; + $this->port = $port; + $this->query = $query; + $this->fragment = $fragment; + } + + /** + * @return string|null + */ + public function getScheme () + { + return $this->scheme; + } + + /** + * @return string|null + */ + public function getHost () + { + return $this->host; + } + + /** + * @return int|null + */ + public function getPort () + { + return $this->port; + } + + /** + * @return string + */ + public function getPath () + { + return $this->path; + } + + /** + * @return QueryInterface + */ + public function getQuery () + { + return $this->query; + } + + /** + * @return string|null + */ + public function getFragment () + { + return $this->fragment; + } + + /** + * @param string $scheme + * + * @return mixed + */ + public function setScheme ($scheme) + { + $this->scheme = $scheme; + + return $this; + } + + /** + * @param string $host + * + * @return mixed + */ + public function setHost ($host) + { + $this->host = $host; + + return $this; + } + + /** + * @param int $port + * + * @return mixed + */ + public function setPort ($port) + { + $this->port = (int) $port; + + return $this; + } + + /** + * @param string $path + * + * @return mixed + */ + public function setPath ($path) + { + $this->path = $path; + + return $this; + } + + /** + * @param QueryInterface $query + * + * @return mixed + */ + public function setQuery (QueryInterface $query) + { + $this->query = $query; + + return $this; + } + + /** + * @param string $fragment + * + * @return mixed + */ + public function setFragment ($fragment) + { + $this->fragment = $fragment; + } + + /** + * @return string + */ + public function __toString () + { + return $this->scheme . '://' . $this->host . $this->path . '?' . $this->query; + } +} \ No newline at end of file