Skip to content

Commit

Permalink
Allow newer version of PSR HTTP message bridge (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
stayallive authored Jan 16, 2024
1 parent bbe0e24 commit 144fc12
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"php": "^7.2 | ^8.0",
"illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0",
"sentry/sentry": "^4.3",
"symfony/psr-http-message-bridge": "^1.0 | ^2.0",
"symfony/psr-http-message-bridge": "^1.0 | ^2.0 | ^6.0 | ^7.0",
"nyholm/psr7": "^1.0"
},
"autoload": {
Expand Down
27 changes: 27 additions & 0 deletions test/Sentry/Http/LaravelRequestFetcherTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Sentry\Http;

use Nyholm\Psr7\ServerRequest;
use Sentry\Laravel\Http\LaravelRequestFetcher;
use Sentry\Laravel\Tests\TestCase;

class LaravelRequestFetcherTest extends TestCase
{
protected function defineRoutes($router): void
{
$router->get('/', function () {
return 'Hello!';
});
}

public function testPsr7InstanceCanBeResolved(): void
{
// The request is only set on the container if we made a request (it is resolved by the SetRequestMiddleware)
$this->get('/');

$instance = $this->app->make(LaravelRequestFetcher::CONTAINER_PSR7_INSTANCE_KEY);

$this->assertInstanceOf(ServerRequest::class, $instance);
}
}

0 comments on commit 144fc12

Please sign in to comment.