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

Issue #3417559 by longwave, Spokje: Remove withConsecutive() in KeyValueEntityStorageTest

(cherry picked from commit ada2ee79)
parent db7c533b
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...
Pipeline #84101 passed with warnings
Pipeline: drupal

#84106

    ...@@ -3441,11 +3441,6 @@ parameters: ...@@ -3441,11 +3441,6 @@ parameters:
    count: 1 count: 1
    path: tests/Drupal/Tests/Core/Entity/EntityUrlTest.php path: tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
    -
    message: "#^Call to deprecated method withConsecutive\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\Builder\\\\InvocationMocker\\.$#"
    count: 6
    path: tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
    - -
    message: "#^Call to deprecated method withConsecutive\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\Builder\\\\InvocationMocker\\.$#" message: "#^Call to deprecated method withConsecutive\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\Builder\\\\InvocationMocker\\.$#"
    count: 1 count: 1
    ......
    ...@@ -158,9 +158,12 @@ public function testCreateWithPredefinedUuid() { ...@@ -158,9 +158,12 @@ public function testCreateWithPredefinedUuid() {
    ->willReturn(get_class($this->getMockEntity())); ->willReturn(get_class($this->getMockEntity()));
    $this->setUpKeyValueEntityStorage(); $this->setUpKeyValueEntityStorage();
    $this->moduleHandler->expects($this->exactly(2)) $hooks = ['test_entity_type_create', 'entity_create'];
    $this->moduleHandler->expects($this->exactly(count($hooks)))
    ->method('invokeAll') ->method('invokeAll')
    ->withConsecutive(['test_entity_type_create'], ['entity_create']); ->with($this->callback(function (string $hook) use (&$hooks): bool {
    return array_shift($hooks) === $hook;
    }));
    $this->uuidService->expects($this->never()) $this->uuidService->expects($this->never())
    ->method('generate'); ->method('generate');
    ...@@ -181,9 +184,12 @@ public function testCreateWithoutUuidKey() { ...@@ -181,9 +184,12 @@ public function testCreateWithoutUuidKey() {
    ->willReturn(get_class($this->getMockEntity())); ->willReturn(get_class($this->getMockEntity()));
    $this->setUpKeyValueEntityStorage(NULL); $this->setUpKeyValueEntityStorage(NULL);
    $this->moduleHandler->expects($this->exactly(2)) $hooks = ['test_entity_type_create', 'entity_create'];
    $this->moduleHandler->expects($this->exactly(count($hooks)))
    ->method('invokeAll') ->method('invokeAll')
    ->withConsecutive(['test_entity_type_create'], ['entity_create']); ->with($this->callback(function (string $hook) use (&$hooks): bool {
    return array_shift($hooks) === $hook;
    }));
    $this->uuidService->expects($this->never()) $this->uuidService->expects($this->never())
    ->method('generate'); ->method('generate');
    ...@@ -206,9 +212,12 @@ public function testCreate() { ...@@ -206,9 +212,12 @@ public function testCreate() {
    ->willReturn(get_class($entity)); ->willReturn(get_class($entity));
    $this->setUpKeyValueEntityStorage(); $this->setUpKeyValueEntityStorage();
    $this->moduleHandler->expects($this->exactly(2)) $hooks = ['test_entity_type_create', 'entity_create'];
    $this->moduleHandler->expects($this->exactly(count($hooks)))
    ->method('invokeAll') ->method('invokeAll')
    ->withConsecutive(['test_entity_type_create'], ['entity_create']); ->with($this->callback(function (string $hook) use (&$hooks): bool {
    return array_shift($hooks) === $hook;
    }));
    $this->uuidService->expects($this->once()) $this->uuidService->expects($this->once())
    ->method('generate') ->method('generate')
    ->willReturn('bar'); ->willReturn('bar');
    ...@@ -248,14 +257,13 @@ public function testSaveInsert(EntityInterface $entity) { ...@@ -248,14 +257,13 @@ public function testSaveInsert(EntityInterface $entity) {
    ->method('toArray') ->method('toArray')
    ->willReturn($expected); ->willReturn($expected);
    $this->moduleHandler->expects($this->exactly(4)) $hooks = ['test_entity_type_presave', 'entity_presave', 'test_entity_type_insert', 'entity_insert'];
    $this->moduleHandler->expects($this->exactly(count($hooks)))
    ->method('invokeAll') ->method('invokeAll')
    ->withConsecutive( ->with($this->callback(function (string $hook) use (&$hooks): bool {
    ['test_entity_type_presave'], return array_shift($hooks) === $hook;
    ['entity_presave'], }));
    ['test_entity_type_insert'],
    ['entity_insert'],
    );
    $this->keyValueStore->expects($this->once()) $this->keyValueStore->expects($this->once())
    ->method('set') ->method('set')
    ->with('foo', $expected); ->with('foo', $expected);
    ...@@ -292,14 +300,14 @@ public function testSaveUpdate(EntityInterface $entity) { ...@@ -292,14 +300,14 @@ public function testSaveUpdate(EntityInterface $entity) {
    ->willReturn([['id' => 'foo']]); ->willReturn([['id' => 'foo']]);
    $this->keyValueStore->expects($this->never()) $this->keyValueStore->expects($this->never())
    ->method('delete'); ->method('delete');
    $this->moduleHandler->expects($this->exactly(4))
    $hooks = ['test_entity_type_presave', 'entity_presave', 'test_entity_type_update', 'entity_update'];
    $this->moduleHandler->expects($this->exactly(count($hooks)))
    ->method('invokeAll') ->method('invokeAll')
    ->withConsecutive( ->with($this->callback(function (string $hook) use (&$hooks): bool {
    ['test_entity_type_presave'], return array_shift($hooks) === $hook;
    ['entity_presave'], }));
    ['test_entity_type_update'],
    ['entity_update'],
    );
    $this->keyValueStore->expects($this->once()) $this->keyValueStore->expects($this->once())
    ->method('set') ->method('set')
    ->with('foo', $expected); ->with('foo', $expected);
    ...@@ -574,12 +582,21 @@ public function testDelete() { ...@@ -574,12 +582,21 @@ public function testDelete() {
    $entities['bar'] = $this->getMockEntity(EntityBaseTest::class, [['id' => 'bar']]); $entities['bar'] = $this->getMockEntity(EntityBaseTest::class, [['id' => 'bar']]);
    $this->setUpKeyValueEntityStorage(); $this->setUpKeyValueEntityStorage();
    $this->moduleHandler->expects($this->exactly(8)) $hooks = [
    'test_entity_type_predelete',
    'entity_predelete',
    'test_entity_type_predelete',
    'entity_predelete',
    'test_entity_type_delete',
    'entity_delete',
    'test_entity_type_delete',
    'entity_delete',
    ];
    $this->moduleHandler->expects($this->exactly(count($hooks)))
    ->method('invokeAll') ->method('invokeAll')
    ->withConsecutive( ->with($this->callback(function (string $hook) use (&$hooks): bool {
    ['test_entity_type_predelete'], return array_shift($hooks) === $hook;
    ['entity_predelete'], }));
    );
    $this->keyValueStore->expects($this->once()) $this->keyValueStore->expects($this->once())
    ->method('deleteMultiple') ->method('deleteMultiple')
    ......
    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