Skip to content

Commit

Permalink
Merge branch '7.1' into 7.2
Browse files Browse the repository at this point in the history
* 7.1:
  do not access typed property before initialization
  do not access typed properties before initialization
  Fix typo in deprecation message
  Symfony 5.4 LTS will get security fixes until Feb 2029 thanks to Ibexa' sponsoring
  Fix #53037
  • Loading branch information
xabbuh committed Oct 22, 2024
2 parents 5ee045b + 6e695b9 commit 29927b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion KernelBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getKernel(): KernelInterface
*/
public function getProfile(): HttpProfile|false|null
{
if (null === $this->response || !$this->getContainer()->has('profiler')) {
if (!isset($this->response) || !$this->getContainer()->has('profiler')) {
return false;
}

Expand Down
8 changes: 8 additions & 0 deletions Tests/KernelBrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\AbstractWebTestCase;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\KernelInterface;

class KernelBrowserTest extends AbstractWebTestCase
{
Expand Down Expand Up @@ -61,6 +62,13 @@ public function testRequestAfterKernelShutdownAndPerformedRequest()
$client->request('GET', '/');
}

public function testGetProfileWithoutRequest()
{
$browser = new KernelBrowser($this->createMock(KernelInterface::class));

$this->assertFalse($browser->getProfile());
}

private function getKernelMock()
{
$mock = $this->getMockBuilder($this->getKernelClass())
Expand Down

0 comments on commit 29927b2

Please sign in to comment.