fix: corrected windows line endings in view tests

pull/635/head
fadrian06 3 weeks ago
parent bc203944ac
commit e5ce02e5bb

@ -13,7 +13,7 @@
{ {
"name": "Franyer Sánchez", "name": "Franyer Sánchez",
"email": "franyeradriansanchez@gmail.com", "email": "franyeradriansanchez@gmail.com",
"homepage": "https://faslatam.000webhostapp.com", "homepage": "https://faslatam.42web.io",
"role": "Maintainer" "role": "Maintainer"
}, },
{ {
@ -44,11 +44,11 @@
"flightphp/runway": "^0.2.3 || ^1.0", "flightphp/runway": "^0.2.3 || ^1.0",
"league/container": "^4.2", "league/container": "^4.2",
"level-2/dice": "^4.0", "level-2/dice": "^4.0",
"phpstan/extension-installer": "^1.3", "phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.10", "phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^9.5", "phpunit/phpunit": "^9.6",
"rregeer/phpunit-coverage-check": "^0.3.1", "rregeer/phpunit-coverage-check": "^0.3.1",
"squizlabs/php_codesniffer": "^3.8" "squizlabs/php_codesniffer": "^3.11"
}, },
"config": { "config": {
"allow-plugins": { "allow-plugins": {

@ -31,6 +31,7 @@
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" /> <exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman.BraceOnSameLine" /> <exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman.BraceOnSameLine" />
<exclude name="Generic.PHP.DisallowRequestSuperglobal.Found" /> <exclude name="Generic.PHP.DisallowRequestSuperglobal.Found" />
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsedHeredocCloser" />
</rule> </rule>
<rule ref="Generic.Files.LineLength"> <rule ref="Generic.Files.LineLength">
<properties> <properties>

@ -209,7 +209,7 @@ class FlightTest extends TestCase
Flight::route('/path1/@param:[a-zA-Z0-9]{2,3}', function () { Flight::route('/path1/@param:[a-zA-Z0-9]{2,3}', function () {
echo 'I win'; echo 'I win';
}, false, 'path1'); }, false, 'path1');
$url = Flight::getUrl('path1', [ 'param' => 123 ]); $url = Flight::getUrl('path1', ['param' => 123]);
$this->assertEquals('/path1/123', $url); $this->assertEquals('/path1/123', $url);
} }
@ -316,7 +316,7 @@ class FlightTest extends TestCase
Flight::register('response', $mock_response_class_name); Flight::register('response', $mock_response_class_name);
Flight::route('/stream', function () { Flight::route('/stream', function () {
echo 'stream'; 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'; Flight::request()->url = '/stream';
$this->expectOutputString('stream'); $this->expectOutputString('stream');
Flight::start(); Flight::start();

@ -220,20 +220,22 @@ class ViewTest extends TestCase
public static function renderDataProvider(): array public static function renderDataProvider(): array
{ {
$html1 = <<<'html' $html1 = <<<'html'
<div>Hi</div> <div>Hi</div>
<div></div> <div></div>
html;
html;
$html2 = <<<'html' $html2 = <<<'html'
<input type="number" /> <input type="number" />
<input type="text" /> <input type="text" />
html; html;
$html1 = str_replace("\n", PHP_EOL, $html1); $html1 = str_replace("\n", PHP_EOL, $html1);
$html2 = str_replace("\n", PHP_EOL, $html2); $html2 = str_replace("\n", PHP_EOL, $html2);
return [ return [
[ [
$html1, $html1,

@ -54,7 +54,7 @@ class RouteCommandTest extends TestCase
protected function newApp(string $name, string $version = '') 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)); return $app->io(new Interactor(static::$in, static::$ou));
} }

Loading…
Cancel
Save