-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality] Add KernelBrowser support on LiteralGetToRequestClassCo…
…nstantRector (#601)
- Loading branch information
1 parent
040014c
commit 05297e1
Showing
4 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...tor/MethodCall/LiteralGetToRequestClassConstantRector/Fixture/from_kernel_browser.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace Rector\Symfony\Tests\CodeQuality\Rector\MethodCall\LiteralGetToRequestClassConstantRector\Fixture; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
|
||
class FromKernelBrowser extends WebTestCase | ||
{ | ||
public function testSomething(): void | ||
{ | ||
// This calls KernelTestCase::bootKernel(), and creates a | ||
// "client" that is acting as the browser | ||
$client = static::createClient(); | ||
|
||
// Request a specific page | ||
$crawler = $client->request('GET', '/'); | ||
|
||
// Validate a successful response and some content | ||
$this->assertResponseIsSuccessful(); | ||
$this->assertSelectorTextContains('h1', 'Hello World'); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Symfony\Tests\CodeQuality\Rector\MethodCall\LiteralGetToRequestClassConstantRector\Fixture; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
|
||
class FromKernelBrowser extends WebTestCase | ||
{ | ||
public function testSomething(): void | ||
{ | ||
// This calls KernelTestCase::bootKernel(), and creates a | ||
// "client" that is acting as the browser | ||
$client = static::createClient(); | ||
|
||
// Request a specific page | ||
$crawler = $client->request(\Symfony\Component\HttpFoundation\Request::METHOD_GET, '/'); | ||
|
||
// Validate a successful response and some content | ||
$this->assertResponseIsSuccessful(); | ||
$this->assertSelectorTextContains('h1', 'Hello World'); | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Symfony\Bundle\FrameworkBundle; | ||
|
||
if (class_exists('Symfony\Bundle\FrameworkBundle\KernelBrowser')) { | ||
return; | ||
} | ||
|
||
final class KernelBrowser | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters