Skip to content
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

fix: corrected windows line endings in view tests #635

Merged
merged 1 commit into from
Mar 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: corrected windows line endings in view tests
fadrian06 committed Mar 9, 2025
commit e5ce02e5bba9644871ce3d32f153f4cff2f65216
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
{
"name": "Franyer Sánchez",
"email": "franyeradriansanchez@gmail.com",
"homepage": "https://faslatam.000webhostapp.com",
"homepage": "https://faslatam.42web.io",
"role": "Maintainer"
},
{
@@ -44,11 +44,11 @@
"flightphp/runway": "^0.2.3 || ^1.0",
"league/container": "^4.2",
"level-2/dice": "^4.0",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.5",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^9.6",
"rregeer/phpunit-coverage-check": "^0.3.1",
"squizlabs/php_codesniffer": "^3.8"
"squizlabs/php_codesniffer": "^3.11"
},
"config": {
"allow-plugins": {
1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman.BraceOnSameLine" />
<exclude name="Generic.PHP.DisallowRequestSuperglobal.Found" />
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsedHeredocCloser" />
</rule>
<rule ref="Generic.Files.LineLength">
<properties>
4 changes: 2 additions & 2 deletions tests/FlightTest.php
Original file line number Diff line number Diff line change
@@ -209,7 +209,7 @@ public function testGetUrl()
Flight::route('/path1/@param:[a-zA-Z0-9]{2,3}', function () {
echo 'I win';
}, false, 'path1');
$url = Flight::getUrl('path1', [ 'param' => 123 ]);
$url = Flight::getUrl('path1', ['param' => 123]);
$this->assertEquals('/path1/123', $url);
}

@@ -316,7 +316,7 @@ public function setRealHeader(string $header_string, bool $replace = true, int $
Flight::register('response', $mock_response_class_name);
Flight::route('/stream', function () {
echo 'stream';
})->streamWithHeaders(['Content-Type' => 'text/plain', 'X-Test' => 'test', 'status' => 200 ]);
})->streamWithHeaders(['Content-Type' => 'text/plain', 'X-Test' => 'test', 'status' => 200]);
Flight::request()->url = '/stream';
$this->expectOutputString('stream');
Flight::start();
14 changes: 8 additions & 6 deletions tests/ViewTest.php
Original file line number Diff line number Diff line change
@@ -220,20 +220,22 @@ public function testKeepThePreviousStateOfDataSettedBySetMethod(): void
public static function renderDataProvider(): array
{
$html1 = <<<'html'
<div>Hi</div>
<div></div>
<div>Hi</div>
<div></div>

html;

html;
$html2 = <<<'html'
<input type="number" />
<input type="number" />
<input type="text" />
<input type="text" />

html;
html;

$html1 = str_replace("\n", PHP_EOL, $html1);
$html2 = str_replace("\n", PHP_EOL, $html2);

return [
[
$html1,
2 changes: 1 addition & 1 deletion tests/commands/RouteCommandTest.php
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ public function tearDown(): void

protected function newApp(string $name, string $version = '')
{
$app = new Application($name, $version ?: '0.0.1', fn () => false);
$app = new Application($name, $version ?: '0.0.1', fn() => false);

return $app->io(new Interactor(static::$in, static::$ou));
}