Commit 06ec77ff authored by catch's avatar catch

Issue #2083175 by damiankloip: Unit test Drupal\serialization\Normalizer\ListNormalizer class.

parent 536319a8
......@@ -18,13 +18,14 @@
* @see \Drupal\serialization\Normalizer\ListNormalizer
*
* @group Drupal
* @group Serialization
*/
class ListNormalizerTest extends UnitTestCase {
/**
* The TypedDataNormalizer instance.
* The ListNormalizer instance.
*
* @var \Drupal\serialization\Normalizer\TypedDataNormalizer
* @var \Drupal\serialization\Normalizer\ListNormalizer
*/
protected $normalizer;
......@@ -44,13 +45,14 @@ class ListNormalizerTest extends UnitTestCase {
public static function getInfo() {
return array(
'name' => 'TypedDataNormalizer',
'description' => 'Tests the TypedDataNormalizer class.',
'name' => 'ListNormalizer',
'description' => 'Tests the ListNormalizer class.',
'group' => 'Serialization',
);
}
public function setUp() {
// Mock the TypedDataManager to return a TypedDataInterface mock.
$typed_data = $this->getMock('Drupal\Core\TypedData\TypedDataInterface');
$typed_data_manager = $this->getMockBuilder('Drupal\Core\TypedData\TypedDataManager')
->disableOriginalConstructor()
......@@ -60,6 +62,8 @@ public function setUp() {
->method('getPropertyInstance')
->will($this->returnValue($typed_data));
// Set up a mock container as ItemList() will call for the 'typed_data'
// service.
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')
->setMethods(array('get'))
->getMock();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment