function YamlTest::testConstants
Same name and namespace in other branches
- main core/tests/Drupal/Tests/Component/Serialization/YamlTest.php \Drupal\Tests\Component\Serialization\YamlTest::testConstants()
Tests decoding PHP constants.
See also
\Drupal\Tests\Component\Serialization\YamlTest::testObjectSupportDisabledPecl()
File
-
core/
tests/ Drupal/ Tests/ Component/ Serialization/ YamlTest.php, line 97
Class
- YamlTest
- Tests the Yaml serialization implementation.
Namespace
Drupal\Tests\Component\SerializationCode
public function testConstants() : void {
$yaml = <<<YAML
foo:
!php/const PHP_INT_MAX
YAML;
$this->assertSame(PHP_INT_MAX, Yaml::decode($yaml)['foo']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.