-
Notifications
You must be signed in to change notification settings - Fork 28
PHPStan improvements #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPStan improvements #100
Changes from 2 commits
ff64b4e
e4f3f1e
54126b5
a8c2fb2
efcc5de
613d036
a64cf16
9a9d3e2
8e296ed
786d9b7
a1950ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,9 @@ | |
|
||
class FixturesKernel implements HttpKernelInterface | ||
{ | ||
public const WEB_FIXTURES_DIR = __DIR__ . '/../web-fixtures'; | ||
public const KERNEL_FIXTURES_DIR = __DIR__ . '/../http-kernel-fixtures'; | ||
|
||
|
||
public function handle(Request $request, $type = 1 /* self::MAIN_REQUEST */ , $catch = true): Response | ||
{ | ||
$this->prepareSession($request); | ||
|
@@ -25,8 +28,8 @@ public function handle(Request $request, $type = 1 /* self::MAIN_REQUEST */ , $c | |
|
||
private function handleFixtureRequest(Request $request): Response | ||
{ | ||
$fixturesDir = realpath(__DIR__ . '/../web-fixtures'); | ||
$overwriteDir = realpath(__DIR__ . '/../http-kernel-fixtures'); | ||
$fixturesDir = realpath(self::WEB_FIXTURES_DIR); | ||
$overwriteDir = realpath(self::KERNEL_FIXTURES_DIR); | ||
|
||
require_once $fixturesDir . '/utils.php'; | ||
|
||
|
@@ -60,8 +63,9 @@ private function prepareSession(Request $request): void | |
|
||
$cookies = $request->cookies; | ||
|
||
if ($cookies->has($session->getName())) { | ||
$session->setId($cookies->get($session->getName())); | ||
$value = $cookies->get($session->getName()); | ||
if ($value !== null) { | ||
uuf6429 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
$session->setId($value); | ||
} else { | ||
$session->migrate(false); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
use Behat\Mink\Exception\DriverException; | ||
use Behat\Mink\Tests\Driver\TestCase; | ||
use Behat\Mink\Tests\Driver\Util\FixturesKernel; | ||
uuf6429 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
final class GeneralTest extends TestCase | ||
{ | ||
|
@@ -77,14 +78,15 @@ public function testFormSubmitWays(string $submitVia): void | |
} | ||
} | ||
|
||
/** | ||
* @return iterable<array{string}> | ||
*/ | ||
public static function formSubmitWaysDataProvider(): iterable | ||
{ | ||
return [ | ||
['Save'], | ||
['input-type-image'], | ||
['button-without-type'], | ||
['button-type-submit'], | ||
]; | ||
yield ['Save']; | ||
yield ['input-type-image']; | ||
yield ['button-without-type']; | ||
yield ['button-type-submit']; | ||
} | ||
|
||
public function testFormSubmit(): void | ||
|
@@ -189,7 +191,7 @@ public function testAdvancedForm(): void | |
$notes->setValue('new notes'); | ||
$this->assertEquals('new notes', $notes->getValue()); | ||
|
||
$about->attachFile($this->mapRemoteFilePath(__DIR__ . '/../../web-fixtures/some_file.txt')); | ||
$about->attachFile($this->mapRemoteFilePath(FixturesKernel::WEB_FIXTURES_DIR . '/some_file.txt')); | ||
|
||
|
||
$button = $page->findButton('Register'); | ||
$this->assertNotNull($button); | ||
|
@@ -352,7 +354,7 @@ public function testSubmitEmptyTextarea(): void | |
/** | ||
* @dataProvider provideInvalidValues | ||
* | ||
* @param mixed $value | ||
* @param array<array-key, mixed>|bool|string $value | ||
*/ | ||
public function testSetInvalidValueInField(string $field, $value): void | ||
{ | ||
|
@@ -366,6 +368,9 @@ public function testSetInvalidValueInField(string $field, $value): void | |
$color->setValue($value); | ||
} | ||
|
||
/** | ||
* @return iterable<string, array{string, mixed}> | ||
*/ | ||
public static function provideInvalidValues(): iterable | ||
{ | ||
$trueValue = ['true', true]; | ||
|
Uh oh!
There was an error while loading. Please reload this page.