Loading core/modules/dblog/tests/src/Functional/DbLogTest.php +7 −32 Original line number Diff line number Diff line Loading @@ -520,7 +520,10 @@ private function doNode($type) { // Create a node using the form in order to generate an add content event // (which is not triggered by drupalCreateNode). $edit = $this->getContent(); $edit = [ 'title[0][value]' => $this->randomMachineName(8), 'body[0][value]' => $this->randomMachineName(32), ]; $title = $edit['title[0][value]']; $this->drupalGet('node/add/' . $type); $this->submitForm($edit, 'Save'); Loading @@ -529,7 +532,9 @@ private function doNode($type) { $node = $this->drupalGetNodeByTitle($title); $this->assertNotNull($node, new FormattableMarkup('Node @title was loaded', ['@title' => $title])); // Edit the node. $edit = $this->getContentUpdate($type); $edit = [ 'body[0][value]' => $this->randomMachineName(32), ]; $this->drupalGet('node/' . $node->id() . '/edit'); $this->submitForm($edit, 'Save'); $this->assertSession()->statusCodeEquals(200); Loading Loading @@ -571,36 +576,6 @@ private function doNode($type) { $this->assertSession()->pageTextContains('node/' . $node->id()); } /** * Creates random content based on node content type. * * @return array * Random content needed by various node types. */ private function getContent() { $content = [ 'title[0][value]' => $this->randomMachineName(8), 'body[0][value]' => $this->randomMachineName(32), ]; return $content; } /** * Creates random content as an update based on node content type. * * @param string $type * Node content type (e.g., 'article'). * * @return array * Random content needed by various node types. */ private function getContentUpdate($type) { $content = [ 'body[0][value]' => $this->randomMachineName(32), ]; return $content; } /** * Tests the addition and clearing of log events through the admin interface. * Loading Loading
core/modules/dblog/tests/src/Functional/DbLogTest.php +7 −32 Original line number Diff line number Diff line Loading @@ -520,7 +520,10 @@ private function doNode($type) { // Create a node using the form in order to generate an add content event // (which is not triggered by drupalCreateNode). $edit = $this->getContent(); $edit = [ 'title[0][value]' => $this->randomMachineName(8), 'body[0][value]' => $this->randomMachineName(32), ]; $title = $edit['title[0][value]']; $this->drupalGet('node/add/' . $type); $this->submitForm($edit, 'Save'); Loading @@ -529,7 +532,9 @@ private function doNode($type) { $node = $this->drupalGetNodeByTitle($title); $this->assertNotNull($node, new FormattableMarkup('Node @title was loaded', ['@title' => $title])); // Edit the node. $edit = $this->getContentUpdate($type); $edit = [ 'body[0][value]' => $this->randomMachineName(32), ]; $this->drupalGet('node/' . $node->id() . '/edit'); $this->submitForm($edit, 'Save'); $this->assertSession()->statusCodeEquals(200); Loading Loading @@ -571,36 +576,6 @@ private function doNode($type) { $this->assertSession()->pageTextContains('node/' . $node->id()); } /** * Creates random content based on node content type. * * @return array * Random content needed by various node types. */ private function getContent() { $content = [ 'title[0][value]' => $this->randomMachineName(8), 'body[0][value]' => $this->randomMachineName(32), ]; return $content; } /** * Creates random content as an update based on node content type. * * @param string $type * Node content type (e.g., 'article'). * * @return array * Random content needed by various node types. */ private function getContentUpdate($type) { $content = [ 'body[0][value]' => $this->randomMachineName(32), ]; return $content; } /** * Tests the addition and clearing of log events through the admin interface. * Loading