Skip to content

Commit db158cc

Browse files
authored
test(phpstan): Fix node publish/unpublish calls in tests (#1354)
1 parent bf9dea3 commit db158cc

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Diff for: .github/workflows/testing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
webonyx/graphql-php:^14.8 \
8787
drupal/typed_data:^1.0 \
8888
drupal/redirect:^1.0 \
89-
phpstan/phpstan:^1.7.14 \
89+
phpstan/phpstan:^1.10.32 \
9090
mglaman/phpstan-drupal:^1.1.2 \
9191
phpstan/phpstan-deprecation-rules:^1.0.0 \
9292
jangregor/phpstan-prophecy:^1.0.0 \

Diff for: phpstan.neon

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ parameters:
1212
# Not sure we can specify generic types properly with Drupal coding standards
1313
# yet, disable for now.
1414
checkGenericClassInNonGenericObjectType: false
15+
# Sometimes we have a mismatch between local execution and CI, we don't care
16+
# about ignored errors that are not triggered.
17+
reportUnmatchedIgnoredErrors: false
1518
excludePaths:
1619
# Exclude the RouteLoad producer because the redirect module is not D10
1720
# compatible so we are not downloading it.

Diff for: tests/src/Kernel/DataProducer/Routing/RouteEntityTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ public function setUp(): void {
5252
$this->unpublished_node->save();
5353

5454
$this->translation_fr_unpublished = $this->unpublished_node->addTranslation('fr', ['title' => 'Test Unpublished Event FR']);
55-
$this->translation_fr_unpublished->status = NodeInterface::NOT_PUBLISHED;
55+
$this->translation_fr_unpublished->setUnpublished();
5656
$this->translation_fr_unpublished->save();
5757

5858
$this->translation_de_unpublished = $this->unpublished_node->addTranslation('de', ['title' => 'Test Unpublished Event DE']);
59-
$this->translation_de_unpublished->status = NodeInterface::NOT_PUBLISHED;
59+
$this->translation_de_unpublished->setUnpublished();
6060
$this->translation_de_unpublished->save();
6161

6262
// Unpublished node to published translations.
@@ -68,11 +68,11 @@ public function setUp(): void {
6868
$this->unpublished_to_published_node->save();
6969

7070
$this->translation_fr_unpublished_to_published = $this->unpublished_to_published_node->addTranslation('fr', ['title' => 'Test Unpublished to Published Event FR']);
71-
$this->translation_fr_unpublished_to_published->status = NodeInterface::PUBLISHED;
71+
$this->translation_fr_unpublished_to_published->setPublished();
7272
$this->translation_fr_unpublished_to_published->save();
7373

7474
$this->translation_de_unpublished_to_published = $this->unpublished_to_published_node->addTranslation('de', ['title' => 'Test Unpublished to Published Event DE']);
75-
$this->translation_de_unpublished_to_published->status = NodeInterface::PUBLISHED;
75+
$this->translation_de_unpublished_to_published->setPublished();
7676
$this->translation_de_unpublished_to_published->save();
7777

7878
// Published node to unpublished translations.
@@ -84,11 +84,11 @@ public function setUp(): void {
8484
$this->published_to_unpublished_node->save();
8585

8686
$this->translation_fr_published_to_unpublished = $this->published_to_unpublished_node->addTranslation('fr', ['title' => 'Test Published to Unpublished Event FR']);
87-
$this->translation_fr_published_to_unpublished->status = NodeInterface::NOT_PUBLISHED;
87+
$this->translation_fr_published_to_unpublished->setUnpublished();
8888
$this->translation_fr_published_to_unpublished->save();
8989

9090
$this->translation_de_published_to_unpublished = $this->published_to_unpublished_node->addTranslation('de', ['title' => 'Test Published to Unpublished Event DE']);
91-
$this->translation_de_published_to_unpublished->status = NodeInterface::NOT_PUBLISHED;
91+
$this->translation_de_published_to_unpublished->setUnpublished();
9292
$this->translation_de_published_to_unpublished->save();
9393

9494
\Drupal::service('content_translation.manager')->setEnabled('node', 'event', TRUE);

0 commit comments

Comments
 (0)