Skip to content
Snippets Groups Projects
Commit 5ee806ab authored by catch's avatar catch
Browse files

Issue #3417551 by longwave, Spokje: Remove withConsecutive() in EntityNormalizerTest

(cherry picked from commit 8474508c)
parent a3cc5307
No related branches found
No related tags found
12 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.,!7567Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7565Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7509Change label "Block description" to "Block type",!7344Issue #3292350 by O'Briat, KlemenDEV, hswong3i, smustgrave, quietone: Update...,!6922Issue #3412959 by quietone, smustgrave, longwave: Fix 12 'un' words,!6848Issue #3417553 by longwave: Remove withConsecutive() in CacheCollectorTest,!6720Revert "Issue #3358581 by pfrenssen, _tarik_, a.dmitriiev, smustgrave:...,!6560Update ClaroPreRender.php, confirming classes provided are in array format,!6528Issue #3414261 by catch: Add authenticated user umami performance tests,!6501Issue #3263668 by omkar-pd, Wim Leers, hooroomoo: Re-enable inline form errors...
Checking pipeline status
...@@ -94,18 +94,11 @@ public function testNormalize() { ...@@ -94,18 +94,11 @@ public function testNormalize() {
->method('getFields') ->method('getFields')
->willReturn($definitions); ->willReturn($definitions);
$serializer = $this->getMockBuilder('Symfony\Component\Serializer\Serializer') $serializer = $this->prophesize('Symfony\Component\Serializer\Serializer');
->disableOriginalConstructor() $serializer->normalize($list_item_1, 'test_format', [])->shouldBeCalled();
->onlyMethods(['normalize']) $serializer->normalize($list_item_2, 'test_format', [])->shouldBeCalled();
->getMock();
$serializer->expects($this->exactly(2))
->method('normalize')
->withConsecutive(
[$list_item_1, 'test_format'],
[$list_item_2, 'test_format'],
);
$this->entityNormalizer->setSerializer($serializer); $this->entityNormalizer->setSerializer($serializer->reveal());
$this->entityNormalizer->normalize($content_entity, 'test_format'); $this->entityNormalizer->normalize($content_entity, 'test_format');
} }
...@@ -224,18 +217,15 @@ public function testDenormalizeWithValidBundle() { ...@@ -224,18 +217,15 @@ public function testDenormalizeWithValidBundle() {
// Setup expectations for the serializer. This will be called for each field // Setup expectations for the serializer. This will be called for each field
// item. // item.
$serializer = $this->getMockBuilder('Symfony\Component\Serializer\Serializer') $serializer = $this->prophesize('Symfony\Component\Serializer\Serializer');
->disableOriginalConstructor() $serializer->denormalize('value_1', get_class($key_1), NULL, ['target_instance' => $key_1, 'entity_type' => 'test'])
->onlyMethods(['denormalize']) ->willReturn(NULL)
->getMock(); ->shouldBeCalled();
$serializer->expects($this->exactly(2)) $serializer->denormalize('value_2', get_class($key_2), NULL, ['target_instance' => $key_2, 'entity_type' => 'test'])
->method('denormalize') ->willReturn(NULL)
->withConsecutive( ->shouldBeCalled();
['value_1', get_class($key_1), NULL, ['target_instance' => $key_1, 'entity_type' => 'test']],
['value_2', get_class($key_2), NULL, ['target_instance' => $key_2, 'entity_type' => 'test']],
);
$this->entityNormalizer->setSerializer($serializer); $this->entityNormalizer->setSerializer($serializer->reveal());
$this->assertNotNull($this->entityNormalizer->denormalize($test_data, 'Drupal\Core\Entity\ContentEntityBase', NULL, ['entity_type' => 'test'])); $this->assertNotNull($this->entityNormalizer->denormalize($test_data, 'Drupal\Core\Entity\ContentEntityBase', NULL, ['entity_type' => 'test']));
} }
...@@ -377,18 +367,15 @@ public function testDenormalizeWithNoBundle() { ...@@ -377,18 +367,15 @@ public function testDenormalizeWithNoBundle() {
// Setup expectations for the serializer. This will be called for each field // Setup expectations for the serializer. This will be called for each field
// item. // item.
$serializer = $this->getMockBuilder('Symfony\Component\Serializer\Serializer') $serializer = $this->prophesize('Symfony\Component\Serializer\Serializer');
->disableOriginalConstructor() $serializer->denormalize('value_1', get_class($key_1), NULL, ['target_instance' => $key_1, 'entity_type' => 'test'])
->onlyMethods(['denormalize']) ->willReturn(NULL)
->getMock(); ->shouldBeCalled();
$serializer->expects($this->exactly(2)) $serializer->denormalize('value_2', get_class($key_2), NULL, ['target_instance' => $key_2, 'entity_type' => 'test'])
->method('denormalize') ->willReturn(NULL)
->withConsecutive( ->shouldBeCalled();
['value_1', get_class($key_1), NULL, ['target_instance' => $key_1, 'entity_type' => 'test']],
['value_2', get_class($key_2), NULL, ['target_instance' => $key_2, 'entity_type' => 'test']], $this->entityNormalizer->setSerializer($serializer->reveal());
);
$this->entityNormalizer->setSerializer($serializer);
$this->assertNotNull($this->entityNormalizer->denormalize($test_data, 'Drupal\Core\Entity\ContentEntityBase', NULL, ['entity_type' => 'test'])); $this->assertNotNull($this->entityNormalizer->denormalize($test_data, 'Drupal\Core\Entity\ContentEntityBase', NULL, ['entity_type' => 'test']));
} }
......
...@@ -2210,11 +2210,6 @@ parameters: ...@@ -2210,11 +2210,6 @@ parameters:
count: 1 count: 1
path: modules/serialization/src/Normalizer/EntityNormalizer.php path: modules/serialization/src/Normalizer/EntityNormalizer.php
-
message: "#^Call to deprecated method withConsecutive\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\Builder\\\\InvocationMocker\\.$#"
count: 3
path: modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php
- -
message: "#^Method Drupal\\\\shortcut\\\\Form\\\\SetCustomize\\:\\:save\\(\\) should return int but return statement is missing\\.$#" message: "#^Method Drupal\\\\shortcut\\\\Form\\\\SetCustomize\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
count: 1 count: 1
......
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