/** * Delete the flag. */ public function doFlagDelete() { // Flag node. $this->drupalGet('node/' . $this->nodeId); $this->assertLink($this->flagShortText); // Go to the delete form for the flag. $this->drupalGet('admin/structure/flags/manage/' . $this->flag->id() . '/delete'); $this->assertText($this->t('Are you sure you want to delete the flag @this_label?', ['@this_label' => $this->label])); $this->drupalPostForm(NULL, [], $this->t('Delete')); // Check the flag has been deleted. $result = $this->flagService->getFlagById($this->flagId); $this->assertNull($result, 'The flag was deleted.'); $this->drupalGet('node/' . $this->nodeId); $this->assertText($this->node->label()); $this->assertNoLink($this->flagShortText); }