Verified Commit 883d501c authored by Jess's avatar Jess
Browse files

Revert "Issue #3293813 by Spokje, longwave, quietone, catch, nod_, bbrala,...

Revert "Issue #3293813 by Spokje, longwave, quietone, catch, nod_, bbrala, xjm: Move RDF-related tests to RDF module"

This reverts commit d95fb87b.
parent d95fb87b
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -1027,6 +1027,43 @@ public function testRecursionDetectedWhenResponseContainsViolationsFrom3042124()
    $this->assertSame(sprintf('title: This value should not be null.'), $data['errors'][0]['detail']);
  }

  /**
   * Ensure that child comments can be retrieved via JSON:API.
   */
  public function testLeakedCacheMetadataViaRdfFromIssue3053827() {
    $this->assertTrue($this->container->get('module_installer')->install(['comment', 'rdf'], TRUE), 'Installed modules.');
    $this->addDefaultCommentField('node', 'article', 'comment', CommentItemInterface::OPEN, 'comment');
    $this->rebuildAll();

    // Create data.
    Node::create([
      'title' => 'Commented Node',
      'type' => 'article',
    ])->save();
    $default_values = [
      'entity_id' => 1,
      'entity_type' => 'node',
      'field_name' => 'comment',
      'status' => 1,
    ];
    $parent = Comment::create(['subject' => 'Marlin'] + $default_values);
    $parent->save();
    $child = Comment::create(['subject' => 'Nemo', 'pid' => $parent->id()] + $default_values);
    $child->save();

    // Test.
    $user = $this->drupalCreateUser(['access comments']);
    $request_options = [
      RequestOptions::AUTH => [
        $user->getAccountName(),
        $user->pass_raw,
      ],
    ];
    // Requesting the comment collection should succeed.
    $response = $this->request('GET', Url::fromUri('internal:/jsonapi/comment/comment'), $request_options);
    $this->assertSame(200, $response->getStatusCode());
  }

  /**
   * Ensure non-translatable entities can be PATCHed with an alternate language.
   *
+1 −3
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\rdf\Functional\Jsonapi;
namespace Drupal\Tests\jsonapi\Functional;

use Drupal\Core\Url;
use Drupal\node\Entity\NodeType;
use Drupal\rdf\Entity\RdfMapping;
use Drupal\Tests\jsonapi\Functional\ConfigEntityResourceTestBase;

/**
 * JSON:API integration test for the "RdfMapping" config entity type.
 *
 * @group jsonapi
 * @group rdf
 */
class RdfMappingTest extends ConfigEntityResourceTestBase {

+3 −0
Original line number Diff line number Diff line
@@ -53,6 +53,9 @@ protected function setUp(): void {
    $this->nodeStorage->delete($this->nodeStorage->loadMultiple());

    $this->loadFixture($this->getModulePath('migrate_drupal') . '/tests/fixtures/drupal6.php');

    // @todo Remove this in https://www.drupal.org/node/3267515
    \Drupal::service('module_installer')->uninstall(['rdf']);
  }

  /**
+3 −0
Original line number Diff line number Diff line
@@ -41,6 +41,9 @@ class MultilingualReviewPageTest extends MultilingualReviewPageTestBase {
  protected function setUp(): void {
    parent::setUp();
    $this->loadFixture($this->getModulePath('migrate_drupal') . '/tests/fixtures/drupal7.php');

    // @todo Remove this in https://www.drupal.org/node/3267515
    \Drupal::service('module_installer')->uninstall(['rdf']);
  }

  /**
+3 −0
Original line number Diff line number Diff line
@@ -37,6 +37,9 @@ class NoMultilingualReviewPageTest extends NoMultilingualReviewPageTestBase {
  protected function setUp(): void {
    parent::setUp();
    $this->loadFixture($this->getModulePath('migrate_drupal') . '/tests/fixtures/drupal7.php');

    // @todo Remove this in https://www.drupal.org/node/3267515
    \Drupal::service('module_installer')->uninstall(['rdf']);
  }

  /**
Loading