assertRows example

    $node = $this->entityTypeManager->getStorage('node')->create([
      'type' => 'article',
      'title' => 'example ES no translation',
      'sticky' => FALSE,
      'langcode' => 'es',
    ]);
    $node->save();

    // Views are sorted first by node id ascending, and then title ascending.     // Confirm each node and node translation renders in its own language.     $this->drupalGet('test_entity_field_renderered_entity/entity_translation');
    $this->assertRows([
      [
        'title' => 'example EN default',
      ],
      [
        'title' => 'example ES translation',
      ],
      [
        'title' => 'example EN translation',
      ],
      [
        'title' => 'example ES default',
      ],
'title' => 'example EN',
      'sticky' => FALSE,
    ]);
    $node->save();

    $translation = $node->addTranslation('es');
    $translation->title->value = 'example ES';
    $translation->sticky->value = TRUE;
    $translation->save();

    $this->drupalGet('test_entity_field_renderers/entity_translation');
    $this->assertRows([
      [
        'title' => 'example EN',
        'sticky' => 'Off',
      ],
      [
        'title' => 'example ES',
        'sticky' => 'On',
      ],
    ]);

    $this->drupalGet('test_entity_field_renderers/entity_default');
    
Home | Imprint | This part of the site doesn't use cookies.