Same name in other branches
  1. 2.x tests/src/Functional/EntityCloneViewTest.php \Drupal\Tests\entity_clone\Functional\EntityCloneViewTest::testViewEntityClone()

Test view entity clone.

Fichier

tests/src/Functional/EntityCloneViewTest.php, line 62

Classe

EntityCloneViewTest
Create a view and test a clone.

Namespace

Drupal\Tests\entity_clone\Functional

Code

public function testViewEntityClone() {
    $edit = [
        'id' => 'test_view_cloned',
        'label' => 'Test view cloned',
    ];
    $this->drupalGet('entity_clone/view/who_s_new');
    $this->submitForm($edit, $this->t('Clone'));
    $views = \Drupal::entityTypeManager()->getStorage('view')
        ->loadByProperties([
        'id' => $edit['id'],
    ]);
    $view = reset($views);
    $this->assertInstanceOf(View::class, $view, 'Test default view cloned found in database.');
}