@@ -24,6 +24,41 @@ class EntityTest extends GraphQLTestBase {
2424 */
2525 protected $ node ;
2626
27+ /**
28+ * Mocked test entity.
29+ *
30+ * @var \Drupal\node\NodeInterface|\PHPUnit\Framework\MockObject\MockObject
31+ */
32+ protected $ entity ;
33+
34+ /**
35+ * Mocked test entity interface.
36+ *
37+ * @var \Drupal\Core\Entity\EntityInterface
38+ */
39+ protected $ entityInterface ;
40+
41+ /**
42+ * Mocked test user.
43+ *
44+ * @var \Drupal\user\UserInterface
45+ */
46+ protected $ user ;
47+
48+ /**
49+ * Translated test entity.
50+ *
51+ * @var \Drupal\node\NodeInterface
52+ */
53+ protected $ translationFr ;
54+
55+ /**
56+ * Translated test entity.
57+ *
58+ * @var \Drupal\node\NodeInterface
59+ */
60+ protected $ translationDe ;
61+
2762 /**
2863 * {@inheritdoc}
2964 */
@@ -34,7 +69,7 @@ public function setUp(): void {
3469 ->disableOriginalConstructor ()
3570 ->getMock ();
3671
37- $ this ->entity_interface = $ this ->getMockBuilder (EntityInterface::class)
72+ $ this ->entityInterface = $ this ->getMockBuilder (EntityInterface::class)
3873 ->disableOriginalConstructor ()
3974 ->getMock ();
4075
@@ -64,11 +99,11 @@ public function setUp(): void {
6499 ]);
65100 $ this ->node ->save ();
66101
67- $ this ->translation_fr = $ this ->node ->addTranslation ('fr ' , ['title ' => 'sit amet fr ' ]);
68- $ this ->translation_fr ->save ();
102+ $ this ->translationFr = $ this ->node ->addTranslation ('fr ' , ['title ' => 'sit amet fr ' ]);
103+ $ this ->translationFr ->save ();
69104
70- $ this ->translation_de = $ this ->node ->addTranslation ('de ' , ['title ' => 'sit amet de ' ]);
71- $ this ->translation_de ->save ();
105+ $ this ->translationDe = $ this ->node ->addTranslation ('de ' , ['title ' => 'sit amet de ' ]);
106+ $ this ->translationDe ->save ();
72107
73108 \Drupal::service ('content_translation.manager ' )->setEnabled ('node ' , 'lorem ' , TRUE );
74109 }
@@ -103,7 +138,7 @@ public function testResolveChanged(): void {
103138
104139 $ this ->assertNull ($ this ->executeDataProducer ('entity_changed ' , [
105140 'format ' => 'Y-m-d ' ,
106- 'entity ' => $ this ->entity_interface ,
141+ 'entity ' => $ this ->entityInterface ,
107142 ]));
108143 }
109144
@@ -122,7 +157,7 @@ public function testResolveCreated(): void {
122157
123158 $ this ->assertNull ($ this ->executeDataProducer ('entity_created ' , [
124159 'format ' => 'Y-m-d ' ,
125- 'entity ' => $ this ->entity_interface ,
160+ 'entity ' => $ this ->entityInterface ,
126161 ]));
127162 }
128163
@@ -199,7 +234,7 @@ public function testResolveOwner(): void {
199234 ]));
200235
201236 $ this ->assertNull ($ this ->executeDataProducer ('entity_owner ' , [
202- 'entity ' => $ this ->entity_interface ,
237+ 'entity ' => $ this ->entityInterface ,
203238 ]));
204239 }
205240
@@ -229,7 +264,7 @@ public function testResolvePublished(): void {
229264 ]));
230265
231266 $ this ->assertNull ($ this ->executeDataProducer ('entity_published ' , [
232- 'entity ' => $ this ->entity_interface ,
267+ 'entity ' => $ this ->entityInterface ,
233268 ]));
234269 }
235270
0 commit comments