Skip to content
Snippets Groups Projects
Commit 06ec77ff authored by catch's avatar catch
Browse files

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

parent 536319a8
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment