diff --git a/tests/Nelmio/Alice/Fixtures/Parser/Files/Yaml/file_with_constants_sf34.yml b/tests/Nelmio/Alice/Fixtures/Parser/Files/Yaml/file_with_constants_sf34.yml new file mode 100644 index 000000000..eb51f7352 --- /dev/null +++ b/tests/Nelmio/Alice/Fixtures/Parser/Files/Yaml/file_with_constants_sf34.yml @@ -0,0 +1,10 @@ +# +# This file is part of the Alice package. +# +# (c) Nelmio +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# + +max_int: !php/const PHP_INT_MAX diff --git a/tests/Nelmio/Alice/Fixtures/Parser/Methods/YamlTest.php b/tests/Nelmio/Alice/Fixtures/Parser/Methods/YamlTest.php index 7d3dbe805..c9afb96fb 100644 --- a/tests/Nelmio/Alice/Fixtures/Parser/Methods/YamlTest.php +++ b/tests/Nelmio/Alice/Fixtures/Parser/Methods/YamlTest.php @@ -83,7 +83,11 @@ public function testParseReturnsInterpretedConstants() if (!defined('Symfony\\Component\\Yaml\\Yaml::PARSE_CONSTANT')) { $this->markTestSkipped('This test needs symfony/yaml v3.2 or higher.'); } - $data = $this->parser->parse(self::$dir.'/file_with_constants.yml'); + $fixture = self::$dir.'/file_with_constants.yml'; + if (method_exists(\Symfony\Component\Yaml\Yaml::class, 'parseFile')) { + $fixture = self::$dir.'/file_with_constants_sf34.yml'; + } + $data = $this->parser->parse($fixture); $this->assertSame( [