diff --git a/core/tests/Drupal/Tests/Component/Yaml/YamlTest.php b/core/tests/Drupal/Tests/Core/Serialization/YamlTest.php similarity index 71% rename from core/tests/Drupal/Tests/Component/Yaml/YamlTest.php rename to core/tests/Drupal/Tests/Core/Serialization/YamlTest.php index 69b5035..5b62289 100644 --- a/core/tests/Drupal/Tests/Component/Yaml/YamlTest.php +++ b/core/tests/Drupal/Tests/Core/Serialization/YamlTest.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Tests\Component\Yaml\YamlTest. + * Contains \Drupal\Tests\Core\Serialization\YamlTest. */ -namespace Drupal\Tests\Component\Yaml; +namespace Drupal\Tests\Core\Serialization; use Drupal\Core\Serialization\YamlSymfony; use Drupal\Core\Serialization\YamlPecl; @@ -15,15 +15,15 @@ * Tests the \Drupal\Core\Serialization\Yaml* implementations. * * @group Drupal - * @group YAML + * @group Serialization */ class YamlTest extends UnitTestCase { public static function getInfo() { return array( - 'name' => 'YAML handling', - 'description' => "Test the parsing and dumping of YAML is consistent between the PECL and Symfony implementations.", - 'group' => 'YAML', + 'name' => 'YAML', + 'description' => "Tests encoding and decoding of YAML is consistent between PECL and Symfony implementations.", + 'group' => 'Serialization API', ); } @@ -34,11 +34,17 @@ protected function setUp() { } /** - * Tests dumping with Symfony and parsing with PECL and vice versa. + * Tests encoding with Symfony and decoding with PECL and vice versa. * * @dataProvider providerYamlData + * @covers \Drupal\Core\Serialization\Yaml::encode + * @covers \Drupal\Core\Serialization\Yaml::decode + * @covers \Drupal\Core\Serialization\YamlPecl::encode + * @covers \Drupal\Core\Serialization\YamlPecl::decode + * @covers \Drupal\Core\Serialization\YamlSymfony::encode + * @covers \Drupal\Core\Serialization\YamlSymfony::decode */ - public function testAlternateDumperParser($data, $parser_class, $dumper_class) { + public function testEncodeDecode($data, $parser_class, $dumper_class) { $dumper = new $dumper_class; $parser = new $parser_class; @@ -50,11 +56,11 @@ public function testAlternateDumperParser($data, $parser_class, $dumper_class) { } /** - * Tests parsing YAML with both Symfony and PECL. + * Tests decoding YAML node anchors with both Symfony and PECL. * * @dataProvider providerYamlNodeAnchors */ - public function testAlternateParsers($data) { + public function testDecodeNodeAnchors($data) { $symfony = new YamlSymfony(); $pecl = new YamlPecl(); $this->assertEquals($symfony->decode($data), $pecl->decode($data)); @@ -89,20 +95,19 @@ public function providerYamlData() { array(10), array(0 => '123456'), ); + // Test parsing with Symfony and dumping with PECL. $data[] = array( $object, 'Drupal\Core\Serialization\YamlSymfony', 'Drupal\Core\Serialization\YamlPecl' ); - // Test parsing with PECL and dumping with Symfony. $data[] = array( $object, 'Drupal\Core\Serialization\YamlPecl', 'Drupal\Core\Serialization\YamlSymfony' ); - return $data; }