Code Duplication    Length = 17-17 lines in 2 locations

tests/Drupal/Tests/Driver/Kernel/Drupal8/Entity/NodeTest.php 2 locations

@@ 70-86 (lines=17) @@
67
  /**
68
   * Test that a node can be created specifying its author by name.
69
   */
70
  public function testNodeCreateWithAuthorName() {
71
    $title = $this->randomString();
72
    $author = $this->createUser();
73
    $authorName = $author->getUsername();
74
    $node = (object) [
75
      'title' => $title,
76
      'type' => 'article',
77
      'author' => $authorName,
78
    ];
79
    $node = $this->driver->createNode($node);
80
81
    $entities = $this->storage->loadByProperties(['title' => $title]);
82
    $this->assertEquals(1, count($entities));
83
    $entity = reset($entities);
84
    $this->assertEquals($author->id(), $entity->getOwnerId());
85
  }
86
87
  /**
88
   * Test that a node can be created specifying its body field.
89
   */
@@ 133-149 (lines=17) @@
130
  /**
131
   * Test that a node can be created specifying its author by name.
132
   */
133
  public function testNodeCreateWithAuthorNameByWrapper() {
134
    $title = $this->randomString();
135
    $author = $this->createUser();
136
    $authorName = $author->getUsername();
137
    $fields = [
138
      'title' => $title,
139
      'type' => 'article',
140
      'author' => $authorName,
141
    ];
142
    $node = DriverEntityDrupal8::create($fields, $this->entityType)->save();
143
144
    $entities = $this->storage->loadByProperties(['title' => $title]);
145
    $this->assertEquals(1, count($entities));
146
    $entity = reset($entities);
147
    $this->assertEquals($author->id(), $entity->getOwnerId());
148
  }
149
150
  /**
151
   * Test that a node can be created specifying its body field.
152
   */