Skip to content

Commit d2dcd33

Browse files
committed
minor #916 [CI] Skip Mercure test if not setup (weaverryan)
This PR was merged into the 1.0-dev branch. Discussion ---------- [CI] Skip Mercure test if not setup This fixes the final failure on AppVeyor, where we don't bother to setup Mercure. Testing this isn't really necessary, as it's covered in the Unix tests anyways - I think that's good enough. Commits ------- 4484837 skip Mercure test if not setup
2 parents 6e951c6 + 4484837 commit d2dcd33

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ init:
2121
- SET PHP=0 # This var is connected to PHP install cache
2222
- SET ANSICON=121x90 (121x90)
2323
- SET MAKER_DISABLE_FILE_LINKS=1
24+
- SET MAKER_SKIP_MERCURE_TEST=1
2425

2526
environment:
2627
TEST_DATABASE_DSN: mysql://root:Password12!@127.0.0.1:3306/test_maker

tests/Maker/MakeEntityTest.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ public function getTestDetails()
565565
->updateSchemaAfterCommand(),
566566
];
567567

568-
yield 'entity_new_broadcast' => [MakerTestDetails::createTest(
568+
$broadCastTest = MakerTestDetails::createTest(
569569
$this->getMakerInstance(MakeEntity::class),
570570
[
571571
// entity class name
@@ -577,7 +577,6 @@ public function getTestDetails()
577577
])
578578
->setRequiredPhpVersion(70200)
579579
->addExtraDependencies('ux-turbo-mercure')
580-
->setFixtureFilesPath(__DIR__.'/../fixtures/MakeEntity')
581580
->configureDatabase()
582581
->addReplacement(
583582
'.env',
@@ -591,8 +590,14 @@ public function getTestDetails()
591590
$content = file_get_contents($directory.'/src/Entity/User.php');
592591
$this->assertStringContainsString('use Symfony\UX\Turbo\Attribute\Broadcast;', $content);
593592
$this->assertStringContainsString(\PHP_VERSION_ID >= 80000 ? '#[Broadcast]' : '@Broadcast', $content);
594-
}),
595-
];
593+
})
594+
;
595+
// use the fixtures - which contains a test for Mercure - unless specified to skip those
596+
$skipMercureTest = $_SERVER['MAKER_SKIP_MERCURE_TEST'] ?? false;
597+
if (!$skipMercureTest) {
598+
$broadCastTest->setFixtureFilesPath(__DIR__.'/../fixtures/MakeEntity');
599+
}
600+
yield 'entity_new_broadcast' => [$broadCastTest];
596601

597602
yield 'entity_new_with_api_and_broadcast_dependencies' => [MakerTestDetails::createTest(
598603
$this->getMakerInstance(MakeEntity::class),

0 commit comments

Comments
 (0)