From 90617830e7c2d6122df0dfabfe54dfe3abc854df Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 20 Mar 2023 11:30:24 +0100 Subject: [PATCH] Skip test when not running in the monorepo Fixes unrelated test failures in https://github.com/hydephp/framework/pull/572. We mostly have this check to catch any mistakes before merging config changes when developing in the monorepo. --- .../tests/Unit/HydeConfigFilesAreMatchingTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/framework/tests/Unit/HydeConfigFilesAreMatchingTest.php b/packages/framework/tests/Unit/HydeConfigFilesAreMatchingTest.php index 5e81e590c42..a056cefe5f2 100644 --- a/packages/framework/tests/Unit/HydeConfigFilesAreMatchingTest.php +++ b/packages/framework/tests/Unit/HydeConfigFilesAreMatchingTest.php @@ -14,6 +14,15 @@ */ class HydeConfigFilesAreMatchingTest extends TestCase { + protected function setUp(): void + { + parent::setUp(); + + if (file_exists(Hyde::path('README.md')) && ! str_contains(file_get_contents(Hyde::path('README.md')), 'HydePHP - Source Monorepo')) { + $this->markTestSkipped('Test skipped when not running in the monorepo.'); + } + } + public function test_hyde_config_files_are_matching() { $this->assertFileEqualsIgnoringNewlineType(