From 2b9242c5674ab97713d3d7f2b5150ccd63dcdf71 Mon Sep 17 00:00:00 2001 From: Lee Rowlands <lee.rowlands@previousnext.com.au> Date: Fri, 3 Jan 2025 12:27:00 +1000 Subject: [PATCH] Issue #3487239 by dpi, smustgrave, mstrelan: Resolve PHPStan-Strict errors: staticMethod.nameCase --- .../contact/tests/src/Functional/ContactPersonalTest.php | 2 +- .../jsonapi/tests/src/Functional/FileUploadTest.php | 4 ++-- .../Drupal/KernelTests/Core/Entity/EntityFieldTest.php | 2 +- .../Core/Config/Checkpoint/CheckpointStorageTest.php | 8 ++++---- .../Drupal/Tests/Core/Config/ReadOnlyStorageTest.php | 8 ++++---- core/tests/Drupal/Tests/Core/Utility/TokenTest.php | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php index c4c7a1db5d3c..be1fb136edaf 100644 --- a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php +++ b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php @@ -127,7 +127,7 @@ public function testSendPersonalContactMessage(): void { // Assert mail content. $this->assertMailString('body', 'Hello ' . $this->contactUser->getDisplayName(), 1); $this->assertMailString('body', $this->webUser->getDisplayName(), 1); - $this->assertMailString('body', Html::Escape($message['message[0][value]']), 1); + $this->assertMailString('body', Html::escape($message['message[0][value]']), 1); } /** diff --git a/core/modules/jsonapi/tests/src/Functional/FileUploadTest.php b/core/modules/jsonapi/tests/src/Functional/FileUploadTest.php index bd6efb306d3f..22f8f7f57d1b 100644 --- a/core/modules/jsonapi/tests/src/Functional/FileUploadTest.php +++ b/core/modules/jsonapi/tests/src/Functional/FileUploadTest.php @@ -874,9 +874,9 @@ protected function setUpAuthorization($method): void { * @internal */ protected function assertResponseData(array $expected, ResponseInterface $response): void { - static::recursiveKSort($expected); + static::recursiveKsort($expected); $actual = $this->getDocumentFromResponse($response); - static::recursiveKSort($actual); + static::recursiveKsort($actual); $this->assertSame($expected, $actual); } diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php index b6051420b4c0..fe70fda8b572 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php @@ -753,7 +753,7 @@ public function testEntityConstraintValidation(): void { ->setLabel('Test entity') ->setSetting('target_type', 'node') ->setSetting('handler_settings', ['target_bundles' => ['article' => 'article']]); - $reference_field = \Drupal::TypedDataManager()->create($definition); + $reference_field = \Drupal::typedDataManager()->create($definition); $reference_field->appendItem(['entity' => $node]); $violations = $reference_field->validate(); $this->assertEquals(1, $violations->count()); diff --git a/core/tests/Drupal/Tests/Core/Config/Checkpoint/CheckpointStorageTest.php b/core/tests/Drupal/Tests/Core/Config/Checkpoint/CheckpointStorageTest.php index 1e1064dcdf29..55cfacd1a91e 100644 --- a/core/tests/Drupal/Tests/Core/Config/Checkpoint/CheckpointStorageTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Checkpoint/CheckpointStorageTest.php @@ -192,12 +192,12 @@ public static function writeMethodsProvider(): array { $data = []; $data[] = ['write', ['config.a', (array) Random::getGenerator()->object()], $fixture]; - $data[] = ['write', [Random::MachineName(), (array) Random::getGenerator()->object()], $fixture]; + $data[] = ['write', [Random::machineName(), (array) Random::getGenerator()->object()], $fixture]; $data[] = ['delete', ['config.a'], $fixture]; - $data[] = ['delete', [Random::MachineName()], $fixture]; + $data[] = ['delete', [Random::machineName()], $fixture]; $data[] = ['rename', ['config.a', 'config.b'], $fixture]; - $data[] = ['rename', ['config.a', Random::MachineName()], $fixture]; - $data[] = ['rename', [Random::MachineName(), Random::MachineName()], $fixture]; + $data[] = ['rename', ['config.a', Random::machineName()], $fixture]; + $data[] = ['rename', [Random::machineName(), Random::machineName()], $fixture]; $data[] = ['deleteAll', [''], $fixture]; $data[] = ['deleteAll', ['config'], $fixture]; $data[] = ['deleteAll', ['other'], $fixture]; diff --git a/core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php b/core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php index 13342b0112c5..6868b859b593 100644 --- a/core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php +++ b/core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php @@ -125,12 +125,12 @@ public static function writeMethodsProvider() { $data = []; $data[] = ['write', ['config.a', (array) Random::getGenerator()->object()], $fixture]; - $data[] = ['write', [Random::MachineName(), (array) Random::getGenerator()->object()], $fixture]; + $data[] = ['write', [Random::machineName(), (array) Random::getGenerator()->object()], $fixture]; $data[] = ['delete', ['config.a'], $fixture]; - $data[] = ['delete', [Random::MachineName()], $fixture]; + $data[] = ['delete', [Random::machineName()], $fixture]; $data[] = ['rename', ['config.a', 'config.b'], $fixture]; - $data[] = ['rename', ['config.a', Random::MachineName()], $fixture]; - $data[] = ['rename', [Random::MachineName(), Random::MachineName()], $fixture]; + $data[] = ['rename', ['config.a', Random::machineName()], $fixture]; + $data[] = ['rename', [Random::machineName(), Random::machineName()], $fixture]; $data[] = ['deleteAll', [''], $fixture]; $data[] = ['deleteAll', ['config'], $fixture]; $data[] = ['deleteAll', ['other'], $fixture]; diff --git a/core/tests/Drupal/Tests/Core/Utility/TokenTest.php b/core/tests/Drupal/Tests/Core/Utility/TokenTest.php index 68e5633bf148..e25d265521c2 100644 --- a/core/tests/Drupal/Tests/Core/Utility/TokenTest.php +++ b/core/tests/Drupal/Tests/Core/Utility/TokenTest.php @@ -338,7 +338,7 @@ protected function setupSiteTokens(): void { // The site name is plain text, but the slogan is markup. $tokens = [ '[site:name]' => 'Your <best> buys', - '[site:slogan]' => Markup::Create('We are <b>best</b>'), + '[site:slogan]' => Markup::create('We are <b>best</b>'), ]; $this->moduleHandler->expects($this->any()) -- GitLab