Skip to content

Commit

Permalink
Update composer dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Stajor committed Jul 9, 2020
1 parent a2f537d commit c4b5fab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"type": "library",
"require": {
"php": ">=7.1",
"guzzlehttp/guzzle": "^6.0"
"guzzlehttp/guzzle": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0",
"vlucas/phpdotenv": "^3.0"
"phpunit/phpunit": "^9.0",
"vlucas/phpdotenv": "^5.0"
},
"autoload": {
"psr-4": {
Expand Down
9 changes: 6 additions & 3 deletions tests/TestClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use Psr\Http\Message\ResponseInterface;

class TestClient extends Client {
protected $body;

public function request($method, $uri = '', array $options = []) {
public function request(string $method, $uri = '', array $options = []): ResponseInterface {
$ex = explode('/', $uri);
$method = end($ex);

if (method_exists($this, $method)) {
$this->body = $this->{$method}(isset($options['form_params']) ? $options['form_params'] : []);
return $this;

return new Response(200, [], $this->body);
} else {
return parent::request($method, $uri, $options);
}
Expand Down Expand Up @@ -48,4 +51,4 @@ protected function getWebhookInfo() {
protected function sendPhoto(array $params) {
return '{"ok":true,"result":{"message_id":1,"from":{"id":123,"is_bot":true,"first_name":"mybot","username":"mybot"},"chat":{"id":123,"first_name":"Alex","last_name":"B","username":"rrr","type":"private"},"date":1530214125,"photo":[{"file_id":"AgADBAADmq0xG7D3qVGRhEmripIm6_nhmxoABJXHWCtlT_tx66ACAAEC","file_size":288,"width":1,"height":1}]}}';
}
}
}
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
copy(__DIR__ .'/.env.example', __DIR__ .'/.env');
}

$dotenv = Dotenv::create(__DIR__);
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();

/*
Expand Down

0 comments on commit c4b5fab

Please sign in to comment.