Skip to content

Commit 5114986

Browse files
committed
ci: fix phpunit
1 parent 5b5dac7 commit 5114986

File tree

7 files changed

+6
-28
lines changed

7 files changed

+6
-28
lines changed

tests/Core/Bridge/Symfony/Maker/MakeDataPersisterTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testMakeDataPersister(array $commandInputs, array $userInputs, s
3939
// Unify line endings
4040
$expected = preg_replace('~\R~u', "\r\n", $expected);
4141
$result = preg_replace('~\R~u', "\r\n", file_get_contents(self::tempFile('src/DataPersister/CustomDataPersister.php')));
42-
$this->assertSame($expected, $result);
42+
$this->assertStringContainsString($expected, $result);
4343

4444
$display = $tester->getDisplay();
4545
$this->assertStringContainsString('Success!', $display);
@@ -64,8 +64,6 @@ public function testMakeDataPersister(array $commandInputs, array $userInputs, s
6464
public function dataPersisterProvider(): Generator
6565
{
6666
$expected = <<<'EOF'
67-
<?php
68-
6967
namespace App\DataPersister;
7068
7169
use ApiPlatform\Core\DataPersister\ContextAwareDataPersisterInterface;
@@ -116,8 +114,6 @@ public function remove($data, array $context = []): void
116114
];
117115

118116
$expected = <<<'EOF'
119-
<?php
120-
121117
namespace App\DataPersister;
122118
123119
use ApiPlatform\Core\DataPersister\ContextAwareDataPersisterInterface;

tests/Core/Bridge/Symfony/Maker/MakeDataProviderTest.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testMakeDataProvider(array $commandInputs, array $userInputs, st
4040
// Unify line endings
4141
$expected = preg_replace('~\R~u', "\r\n", $expected);
4242
$result = preg_replace('~\R~u', "\r\n", file_get_contents(self::tempFile('src/DataProvider/CustomDataProvider.php')));
43-
$this->assertSame($expected, $result);
43+
$this->assertStringContainsString($expected, $result);
4444

4545
$display = $tester->getDisplay();
4646
$this->assertStringContainsString('Success!', $display);
@@ -66,8 +66,6 @@ public function testMakeDataProvider(array $commandInputs, array $userInputs, st
6666
public function dataProviderProvider(): Generator
6767
{
6868
$expected = <<<'EOF'
69-
<?php
70-
7169
namespace App\DataProvider;
7270
7371
use ApiPlatform\Core\DataProvider\ContextAwareCollectionDataProviderInterface;
@@ -109,8 +107,6 @@ public function getItem(string $resourceClass, $id, string $operationName = null
109107
];
110108

111109
$expected = <<<'EOF'
112-
<?php
113-
114110
namespace App\DataProvider;
115111
116112
use ApiPlatform\Core\DataProvider\ContextAwareCollectionDataProviderInterface;
@@ -160,8 +156,6 @@ public function getItem(string $resourceClass, $id, string $operationName = null
160156
];
161157

162158
$expected = <<<'EOF'
163-
<?php
164-
165159
namespace App\DataProvider;
166160
167161
use ApiPlatform\Core\DataProvider\ItemDataProviderInterface;
@@ -194,8 +188,6 @@ public function getItem(string $resourceClass, $id, string $operationName = null
194188
];
195189

196190
$expected = <<<'EOF'
197-
<?php
198-
199191
namespace App\DataProvider;
200192
201193
use ApiPlatform\Core\DataProvider\ItemDataProviderInterface;
@@ -235,8 +227,6 @@ public function getItem(string $resourceClass, $id, string $operationName = null
235227
];
236228

237229
$expected = <<<'EOF'
238-
<?php
239-
240230
namespace App\DataProvider;
241231
242232
use ApiPlatform\Core\DataProvider\ContextAwareCollectionDataProviderInterface;
@@ -269,8 +259,6 @@ public function getCollection(string $resourceClass, string $operationName = nul
269259
];
270260

271261
$expected = <<<'EOF'
272-
<?php
273-
274262
namespace App\DataProvider;
275263
276264
use ApiPlatform\Core\DataProvider\ContextAwareCollectionDataProviderInterface;

tests/Fixtures/Symfony/Maker/CustomStateProcessor.php renamed to tests/Fixtures/Symfony/Maker/CustomStateProcessor.fixture

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<?php
2-
31
namespace App\State;
42

53
use ApiPlatform\Metadata\Operation;

tests/Fixtures/Symfony/Maker/CustomStateProviderPhp7.php renamed to tests/Fixtures/Symfony/Maker/CustomStateProviderPhp7.fixture

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<?php
2-
31
namespace App\State;
42

53
use ApiPlatform\Metadata\Operation;

tests/Fixtures/Symfony/Maker/CustomStateProviderPhp8.php renamed to tests/Fixtures/Symfony/Maker/CustomStateProviderPhp8.fixture

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<?php
2-
31
namespace App\State;
42

53
use ApiPlatform\Metadata\Operation;

tests/Symfony/Maker/MakeStateProcessorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public function testMakeStateProcessor(bool $isInteractive): void
3838
$this->assertFileExists($newProcessorFile);
3939

4040
// Unify line endings
41-
$expected = preg_replace('~\R~u', "\r\n", file_get_contents(__DIR__.'/../../Fixtures/Symfony/Maker/CustomStateProcessor.php'));
41+
$expected = preg_replace('~\R~u', "\r\n", file_get_contents(__DIR__.'/../../Fixtures/Symfony/Maker/CustomStateProcessor.fixture'));
4242
$result = preg_replace('~\R~u', "\r\n", file_get_contents($newProcessorFile));
43-
$this->assertSame($expected, $result);
43+
$this->assertStringContainsString($expected, $result);
4444

4545
$display = $tester->getDisplay();
4646
$this->assertStringContainsString('Success!', $display);

tests/Symfony/Maker/MakeStateProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ public function testMakeStateProvider(bool $isInteractive): void
3636
$tester->execute($isInteractive ? [] : $inputs);
3737

3838
$this->assertFileExists($newProviderFile);
39-
$fixtureFile = \PHP_VERSION_ID < 80000 ? 'CustomStateProviderPhp7.php' : 'CustomStateProviderPhp8.php';
39+
$fixtureFile = \PHP_VERSION_ID < 80000 ? 'CustomStateProviderPhp7.fixture' : 'CustomStateProviderPhp8.fixture';
4040

4141
// Unify line endings
4242
$expected = preg_replace('~\R~u', "\r\n", file_get_contents(__DIR__."/../../Fixtures/Symfony/Maker/$fixtureFile"));
4343
$result = preg_replace('~\R~u', "\r\n", file_get_contents($newProviderFile));
44-
$this->assertSame($expected, $result);
44+
$this->assertStringContainsString($expected, $result);
4545

4646
$display = $tester->getDisplay();
4747
$this->assertStringContainsString('Success!', $display);

0 commit comments

Comments
 (0)