From a104767e10314ebce30f19638f5d216773cb5c01 Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.uk>
Date: Sat, 21 Oct 2017 20:25:33 +0100
Subject: [PATCH] Create some test content

This includes some content of different types, as well as a
mixture of published and unpublished content. This mean that
we can test that these nodes are not returned in addition to
ensuring that the correct ones are returned.
---
 tests/src/Functional/PageListTest.php | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/src/Functional/PageListTest.php b/tests/src/Functional/PageListTest.php
index ccce3c8..3ea80a5 100644
--- a/tests/src/Functional/PageListTest.php
+++ b/tests/src/Functional/PageListTest.php
@@ -28,8 +28,16 @@ class PageListTest extends BrowserTestBase {
    * pages or content of different types should not be shown.
    */
   public function testOnlyPublishedPagesAreShown() {
-    // Given that a have a mixture of published and unpublished pages, as well
-    // as other types of content.
+    $this->drupalCreateContentType(['type' => 'article']);
+
+    // This is a published page, so it should be visible.
+    $this->drupalCreateNode(['type' => 'page', 'status' => TRUE]);
+
+    // This is an article, so it should not be visible.
+    $this->drupalCreateNode(['type' => 'article']);
+
+    // This page is not published, so it should not be visible.
+    $this->drupalCreateNode(['type' => 'page', 'status' => FALSE]);
 
     // When I view the page.