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

Issue #3419201 by longwave, Spokje: Remove withConsecutive() in TempStore tests

parent 63c3ce45
No related branches found
No related tags found
No related merge requests found
...@@ -3403,16 +3403,6 @@ parameters: ...@@ -3403,16 +3403,6 @@ parameters:
count: 1 count: 1
path: tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php path: tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php
-
message: "#^Call to deprecated method withConsecutive\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\Builder\\\\InvocationMocker\\.$#"
count: 2
path: tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php
-
message: "#^Call to deprecated method withConsecutive\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\Builder\\\\InvocationMocker\\.$#"
count: 3
path: tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php
- -
message: "#^Variable \\$value in isset\\(\\) always exists and is not nullable\\.$#" message: "#^Variable \\$value in isset\\(\\) always exists and is not nullable\\.$#"
count: 1 count: 1
......
...@@ -102,13 +102,12 @@ protected function setUp(): void { ...@@ -102,13 +102,12 @@ protected function setUp(): void {
* @covers ::get * @covers ::get
*/ */
public function testGet() { public function testGet() {
$this->keyValue->expects($this->exactly(3)) $calls = ['1:test_2', '1:test', '1:test'];
$this->keyValue->expects($this->exactly(count($calls)))
->method('get') ->method('get')
->withConsecutive( ->with($this->callback(function (string $key) use (&$calls): bool {
['1:test_2'], return array_shift($calls) == $key;
['1:test'], }))
['1:test'],
)
->willReturnOnConsecutiveCalls( ->willReturnOnConsecutiveCalls(
FALSE, FALSE,
$this->ownObject, $this->ownObject,
...@@ -248,13 +247,12 @@ public function testDelete() { ...@@ -248,13 +247,12 @@ public function testDelete() {
->with('1:test_2') ->with('1:test_2')
->willReturn(TRUE); ->willReturn(TRUE);
$this->keyValue->expects($this->exactly(3)) $calls = ['1:test_1', '1:test_2', '1:test_3'];
$this->keyValue->expects($this->exactly(count($calls)))
->method('get') ->method('get')
->withConsecutive( ->with($this->callback(function (string $key) use (&$calls): bool {
['1:test_1'], return array_shift($calls) == $key;
['1:test_2'], }))
['1:test_3'],
)
->willReturnOnConsecutiveCalls( ->willReturnOnConsecutiveCalls(
FALSE, FALSE,
$this->ownObject, $this->ownObject,
......
...@@ -101,12 +101,12 @@ protected function setUp(): void { ...@@ -101,12 +101,12 @@ protected function setUp(): void {
* @covers ::get * @covers ::get
*/ */
public function testGet() { public function testGet() {
$this->keyValue->expects($this->exactly(2)) $calls = ['test_2', 'test'];
$this->keyValue->expects($this->exactly(count($calls)))
->method('get') ->method('get')
->withConsecutive( ->with($this->callback(function (string $key) use (&$calls): bool {
['test_2'], return array_shift($calls) == $key;
['test'], }))
)
->willReturnOnConsecutiveCalls( ->willReturnOnConsecutiveCalls(
FALSE, FALSE,
$this->ownObject, $this->ownObject,
...@@ -122,13 +122,12 @@ public function testGet() { ...@@ -122,13 +122,12 @@ public function testGet() {
* @covers ::getIfOwner * @covers ::getIfOwner
*/ */
public function testGetIfOwner() { public function testGetIfOwner() {
$this->keyValue->expects($this->exactly(3)) $calls = ['test_2', 'test', 'test'];
$this->keyValue->expects($this->exactly(count($calls)))
->method('get') ->method('get')
->withConsecutive( ->with($this->callback(function (string $key) use (&$calls): bool {
['test_2'], return array_shift($calls) == $key;
['test'], }))
['test'],
)
->willReturnOnConsecutiveCalls( ->willReturnOnConsecutiveCalls(
FALSE, FALSE,
$this->ownObject, $this->ownObject,
...@@ -328,13 +327,12 @@ public function testDeleteIfOwner() { ...@@ -328,13 +327,12 @@ public function testDeleteIfOwner() {
->with('test_2') ->with('test_2')
->willReturn(TRUE); ->willReturn(TRUE);
$this->keyValue->expects($this->exactly(3)) $calls = ['test_1', 'test_2', 'test_3'];
$this->keyValue->expects($this->exactly(count($calls)))
->method('get') ->method('get')
->withConsecutive( ->with($this->callback(function (string $key) use (&$calls): bool {
['test_1'], return array_shift($calls) == $key;
['test_2'], }))
['test_3'],
)
->willReturnOnConsecutiveCalls( ->willReturnOnConsecutiveCalls(
FALSE, FALSE,
$this->ownObject, $this->ownObject,
......
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