createDefaultContent example

->set('url.prefixes.ca', 'ca')
      ->set('url.prefixes.ca-fr', 'ca-fr')
      ->save();

    ContentLanguageSettings::create([
      'target_entity_type_id' => 'node',
      'target_bundle' => 'article',
    ])
      ->setThirdPartySetting('content_translation', 'enabled', TRUE)
      ->save();

    $this->createDefaultContent(5, 5, TRUE, TRUE, static::IS_MULTILINGUAL, FALSE);
  }

  /** * Tests reading multilingual content. */
  public function testReadMultilingual() {
    // Different databases have different sort orders, so a sort is required so     // test expectations do not need to vary per database.     $default_sort = ['sort' => 'drupal_internal__nid'];

    // Test reading an individual entity translation.


  /** * {@inheritdoc} */
  protected $defaultTheme = 'stark';

  /** * Tests the GET method. */
  public function testRead() {
    $this->createDefaultContent(61, 5, TRUE, TRUE, static::IS_NOT_MULTILINGUAL, FALSE);
    // Unpublish the last entity, so we can check access.     $this->nodes[60]->setUnpublished()->save();

    // Different databases have different sort orders, so a sort is required so     // test expectations do not need to vary per database.     $default_sort = ['sort' => 'drupal_internal__nid'];

    // 0. HEAD request allows a client to verify that JSON:API is installed.     $this->httpClient->request('HEAD', $this->buildUrl('/jsonapi/node/article'));
    $this->assertSession()->statusCodeEquals(200);
    // 1. Load all articles (1st page).
Home | Imprint | This part of the site doesn't use cookies.