Unverified Commit db158cc1 authored by Klaus Purer's avatar Klaus Purer Committed by GitHub
Browse files

test(phpstan): Fix node publish/unpublish calls in tests (#1354)

parent bf9dea39
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ jobs:
          webonyx/graphql-php:^14.8 \
          drupal/typed_data:^1.0 \
          drupal/redirect:^1.0 \
          phpstan/phpstan:^1.7.14 \
          phpstan/phpstan:^1.10.32 \
          mglaman/phpstan-drupal:^1.1.2 \
          phpstan/phpstan-deprecation-rules:^1.0.0 \
          jangregor/phpstan-prophecy:^1.0.0 \
+3 −0
Original line number Diff line number Diff line
@@ -12,6 +12,9 @@ parameters:
  # Not sure we can specify generic types properly with Drupal coding standards
  # yet, disable for now.
  checkGenericClassInNonGenericObjectType: false
  # Sometimes we have a mismatch between local execution and CI, we don't care
  # about ignored errors that are not triggered.
  reportUnmatchedIgnoredErrors: false
  excludePaths:
    # Exclude the RouteLoad producer because the redirect module is not D10
    # compatible so we are not downloading it.
+6 −6
Original line number Diff line number Diff line
@@ -52,11 +52,11 @@ class RouteEntityTest extends GraphQLTestBase {
    $this->unpublished_node->save();

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

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

    // Unpublished node to published translations.
@@ -68,11 +68,11 @@ class RouteEntityTest extends GraphQLTestBase {
    $this->unpublished_to_published_node->save();

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

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

    // Published node to unpublished translations.
@@ -84,11 +84,11 @@ class RouteEntityTest extends GraphQLTestBase {
    $this->published_to_unpublished_node->save();

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

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

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