From ddbeaf163698615a51fb48413f0e2c9c63626fb1 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Fri, 29 May 2026 11:08:43 -0400 Subject: [PATCH 1/4] bump From d9fbe68fb616eb9a3f2c785d9b0e0d89ab8acd7f Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Fri, 29 May 2026 11:12:01 -0400 Subject: [PATCH 2/4] editing a php file so tests run --- src/Statamic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Statamic.php b/src/Statamic.php index 67e9cf59ad..21fd4bc2c9 100644 --- a/src/Statamic.php +++ b/src/Statamic.php @@ -20,7 +20,7 @@ use Statamic\Support\TextDirection; use Statamic\Tags\FluentTag; -class Statamic +class Statamic // { const CORE_SLUG = 'statamic'; const PACKAGE = 'statamic/cms'; From f9e1762ce166c478d62d98eecb8234c52e57500c Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Fri, 29 May 2026 12:18:37 -0400 Subject: [PATCH 3/4] normalize yaml --- tests/Assets/AssetRepositoryTest.php | 4 ++-- tests/Data/Globals/VariablesTest.php | 4 ++-- tests/Stache/Stores/CollectionTreeStoreTest.php | 5 ++--- tests/Stache/Stores/NavTreeStoreTest.php | 5 ++--- tests/TestCase.php | 9 +++++++++ tests/Yaml/YamlTest.php | 8 ++++---- 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/tests/Assets/AssetRepositoryTest.php b/tests/Assets/AssetRepositoryTest.php index 6d9d4c755f..be2ea47f8a 100644 --- a/tests/Assets/AssetRepositoryTest.php +++ b/tests/Assets/AssetRepositoryTest.php @@ -36,7 +36,7 @@ public function it_saves_the_meta_file_to_disk() $disk->assertExists($path = 'foo/.meta/image.jpg.yaml'); $contents = <<assertEquals($contents, $disk->get($path)); + $this->assertEquals($contents, $this->normalizeYaml($disk->get($path))); } #[Test] diff --git a/tests/Data/Globals/VariablesTest.php b/tests/Data/Globals/VariablesTest.php index 9bcfbb65ad..806cada0ad 100644 --- a/tests/Data/Globals/VariablesTest.php +++ b/tests/Data/Globals/VariablesTest.php @@ -96,10 +96,10 @@ public function it_gets_file_contents_for_saving_a_localized_set() - 'second one' string: 'The string' 'null': null -empty: { } +empty: {} EOT; - $this->assertEquals($expected, $b->fileContents()); + $this->assertEquals($expected, $this->normalizeYaml($b->fileContents())); $expected = <<<'EOT' array: diff --git a/tests/Stache/Stores/CollectionTreeStoreTest.php b/tests/Stache/Stores/CollectionTreeStoreTest.php index a98459069c..0120f43b03 100644 --- a/tests/Stache/Stores/CollectionTreeStoreTest.php +++ b/tests/Stache/Stores/CollectionTreeStoreTest.php @@ -160,12 +160,11 @@ public function it_saves_to_disk() $expected = <<<'EOT' tree: - - - entry: test + - entry: test EOT; - $this->assertStringEqualsFile($this->tempDir.'/pages.yaml', $expected); + $this->assertEquals($expected, $this->normalizeYaml(file_get_contents($this->tempDir.'/pages.yaml'))); } private function assertTree($array, $item) diff --git a/tests/Stache/Stores/NavTreeStoreTest.php b/tests/Stache/Stores/NavTreeStoreTest.php index 1587391d96..4fb46db642 100644 --- a/tests/Stache/Stores/NavTreeStoreTest.php +++ b/tests/Stache/Stores/NavTreeStoreTest.php @@ -123,13 +123,12 @@ public function it_saves_to_disk() $expected = <<<'EOT' tree: - - - title: Test + - title: Test url: /test EOT; - $this->assertStringEqualsFile($this->tempDir.'/links.yaml', $expected); + $this->assertEquals($expected, $this->normalizeYaml(file_get_contents($this->tempDir.'/links.yaml'))); } private function assertTree($array, $item) diff --git a/tests/TestCase.php b/tests/TestCase.php index e219e3695e..e23b8e2056 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -200,6 +200,15 @@ protected function assertEveryItemIsInstanceOf($class, $items) $this->assertEquals(count($items), $matches, 'Failed asserting that every item is an instance of '.$class); } + protected function normalizeYaml(string $yaml): string + { + // Normalize formatting changes introduced in symfony/yaml 8.1 + $yaml = str_replace('{ }', '{}', $yaml); + $yaml = preg_replace('/^( *)-\n\1 (\S)/m', '$1- $2', $yaml); + + return $yaml; + } + protected function assertContainsHtml($string) { preg_match('/<[^<]+>/', $string, $matches); diff --git a/tests/Yaml/YamlTest.php b/tests/Yaml/YamlTest.php index 1626abd4c4..fc1e6a2630 100644 --- a/tests/Yaml/YamlTest.php +++ b/tests/Yaml/YamlTest.php @@ -68,11 +68,11 @@ public function it_dumps_without_front_matter_when_content_is_an_empty_array() { $expected = <<<'EOT' foo: bar -content: { } +content: {} EOT; - $this->assertEquals($expected, YAML::dump(['foo' => 'bar'], [])); + $this->assertEquals($expected, $this->normalizeYaml(YAML::dump(['foo' => 'bar'], []))); } #[Test] @@ -134,12 +134,12 @@ public function it_explicitly_dumps_front_matter_including_content_when_its_an_e $expected = <<<'EOT' --- foo: bar -content: { } +content: {} --- EOT; - $this->assertStringEqualsStringIgnoringLineEndings($expected, YAML::dumpFrontMatter(['foo' => 'bar'], [])); + $this->assertStringEqualsStringIgnoringLineEndings($expected, $this->normalizeYaml(YAML::dumpFrontMatter(['foo' => 'bar'], []))); } #[Test] From e19f842bf11626cb675add92fd602ea26cc85ca4 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Fri, 29 May 2026 16:29:24 -0400 Subject: [PATCH 4/4] undo --- src/Statamic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Statamic.php b/src/Statamic.php index 21fd4bc2c9..67e9cf59ad 100644 --- a/src/Statamic.php +++ b/src/Statamic.php @@ -20,7 +20,7 @@ use Statamic\Support\TextDirection; use Statamic\Tags\FluentTag; -class Statamic // +class Statamic { const CORE_SLUG = 'statamic'; const PACKAGE = 'statamic/cms';