|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace Tests;
|
|
|
|
|
|
+use GuzzleHttp\Psr7\Response;
|
|
|
use PHPUnit\Framework\TestCase as BaseTestCase;
|
|
|
|
|
|
abstract class TestCase extends BaseTestCase
|
|
@@ -16,4 +17,26 @@ abstract class TestCase extends BaseTestCase
|
|
|
|
|
|
$this->client = new Client();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $uri
|
|
|
+ * @param array $parameters
|
|
|
+ * @return Response|object
|
|
|
+ */
|
|
|
+ public function get(string $uri, array $parameters = [])
|
|
|
+ {
|
|
|
+ $this->client->request('GET', $uri, $parameters);
|
|
|
+ return $this->client->getResponse();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $uri
|
|
|
+ * @param array $parameters
|
|
|
+ * @return Response|object
|
|
|
+ */
|
|
|
+ public function post(string $uri, array $parameters = [])
|
|
|
+ {
|
|
|
+ $this->client->request('POST', $uri, $parameters);
|
|
|
+ return $this->client->getResponse();
|
|
|
+ }
|
|
|
}
|