Skip to content

Commit

Permalink
[test] php-cs-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Dec 20, 2023
1 parent f12b9ac commit 7452251
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/test/sfInternalServerBasedFixtureTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* file that was distributed with this source code.
*/

use PHPUnit\Framework\TestCase;

/**
* Idea from Symfony's http foundation component.
*
Expand All @@ -24,8 +22,8 @@ trait sfInternalServerBasedFixtureTestTrait
public static function setUpBeforeClass(): void
{
$descriptorPipes = array(
1 => ['file', '/dev/null', 'w'],
2 => ['file', '/dev/null', 'w'],
1 => array('file', '/dev/null', 'w'),
2 => array('file', '/dev/null', 'w'),
);
self::$server = proc_open('exec '.\PHP_BINARY.' -S localhost:8300', $descriptorPipes, $pipes, self::$fixtureDirectory);

Expand All @@ -45,9 +43,9 @@ public static function tearDownAfterClass(): void
*/
public function testFixtures($fixture)
{
$context = stream_context_create([]);
$context = stream_context_create(array());
$result = file_get_contents(sprintf('http://localhost:8300/%s.php', $fixture), false, $context);
$result = preg_replace_callback('/expires=[^;]++/', fn($m) => str_replace('-', ' ', $m[0]), $result);
$result = preg_replace_callback('/expires=[^;]++/', fn ($m) => str_replace('-', ' ', $m[0]), $result);

$expectedFilename = sprintf(self::$fixtureDirectory.'/%s.expected', $fixture);
$notExpectedFilename = sprintf(self::$fixtureDirectory.'/%s.not_expected', $fixture);
Expand All @@ -61,10 +59,10 @@ public function testFixtures($fixture)
}
}

public function provideFixtures(): \Generator
public function provideFixtures(): Generator
{
foreach (glob(self::$fixtureDirectory.'/*.php') as $file) {
yield [pathinfo($file, \PATHINFO_FILENAME)];
yield array(pathinfo($file, \PATHINFO_FILENAME));
}
}
}

0 comments on commit 7452251

Please sign in to comment.