From ee469ef5c8a9db37a3f4a4ccb2e705cff90e21e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= <gabor@hojtsy.hu>
Date: Thu, 8 Oct 2020 10:38:21 +0200
Subject: [PATCH] =?UTF-8?q?Issue=20#3042743=20by=20G=C3=A1bor=20Hojtsy:=20?=
 =?UTF-8?q?Followup=20test=20updates=20for=20Drupal=209=20support?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/Tests/Condition/PhpConditionTest.php        | 4 ++--
 src/Tests/{ => Functional}/PhpAccessTest.php    | 2 +-
 src/Tests/{ => Functional}/PhpFilterTest.php    | 2 +-
 src/Tests/{ => Functional}/PhpTestBase.php      | 6 +++---
 src/Tests/{ => Functional}/PhpUninstallTest.php | 6 +++---
 5 files changed, 10 insertions(+), 10 deletions(-)
 rename src/Tests/{ => Functional}/PhpAccessTest.php (96%)
 rename src/Tests/{ => Functional}/PhpFilterTest.php (97%)
 rename src/Tests/{ => Functional}/PhpTestBase.php (94%)
 rename src/Tests/{ => Functional}/PhpUninstallTest.php (90%)

diff --git a/src/Tests/Condition/PhpConditionTest.php b/src/Tests/Condition/PhpConditionTest.php
index 9e7ea0f..96ad52b 100644
--- a/src/Tests/Condition/PhpConditionTest.php
+++ b/src/Tests/Condition/PhpConditionTest.php
@@ -41,13 +41,13 @@ class PhpConditionTest extends KernelTestBase {
     // Grab the PHP condition and configure it to check against a php snippet.
     $condition = $this->manager->createInstance('php')
       ->setConfig('php', '<?php return TRUE; ?>');
-    $this->assertTrue($condition->execute(), 'PHP condition passes as expected.');
+    $this->assertTrue((bool) $condition->execute(), 'PHP condition passes as expected.');
     // Check for the proper summary.
     self::assertEquals($condition->summary(), 'When the given PHP evaluates as TRUE.');
 
     // Set the PHP snippet to return FALSE.
     $condition->setConfig('php', '<?php return FALSE; ?>');
-    $this->assertFalse($condition->execute(), 'PHP condition fails as expected.');
+    $this->assertFalse((bool) $condition->execute(), 'PHP condition fails as expected.');
 
     // Negate the condition.
     $condition->setConfig('negate', TRUE);
diff --git a/src/Tests/PhpAccessTest.php b/src/Tests/Functional/PhpAccessTest.php
similarity index 96%
rename from src/Tests/PhpAccessTest.php
rename to src/Tests/Functional/PhpAccessTest.php
index 8ed6d85..7fd9618 100644
--- a/src/Tests/PhpAccessTest.php
+++ b/src/Tests/Functional/PhpAccessTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\php\Tests;
+namespace Drupal\Tests\php\Functional;
 
 /**
  * Tests to make sure access to the PHP filter is properly restricted.
diff --git a/src/Tests/PhpFilterTest.php b/src/Tests/Functional/PhpFilterTest.php
similarity index 97%
rename from src/Tests/PhpFilterTest.php
rename to src/Tests/Functional/PhpFilterTest.php
index e9a5129..069f6dd 100644
--- a/src/Tests/PhpFilterTest.php
+++ b/src/Tests/Functional/PhpFilterTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\php\Tests;
+namespace Drupal\Tests\php\Functional;
 
 /**
  * Tests to make sure the PHP filter actually evaluates PHP code when used.
diff --git a/src/Tests/PhpTestBase.php b/src/Tests/Functional/PhpTestBase.php
similarity index 94%
rename from src/Tests/PhpTestBase.php
rename to src/Tests/Functional/PhpTestBase.php
index 796d949..da256e3 100644
--- a/src/Tests/PhpTestBase.php
+++ b/src/Tests/Functional/PhpTestBase.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\php\Tests;
+namespace Drupal\Tests\php\Functional;
 
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 use Drupal\user\RoleInterface;
 
 /**
@@ -10,7 +10,7 @@ use Drupal\user\RoleInterface;
  *
  * @group PHP
  */
-abstract class PhpTestBase extends WebTestBase {
+abstract class PhpTestBase extends BrowserTestBase {
 
   /**
    * Modules to enable.
diff --git a/src/Tests/PhpUninstallTest.php b/src/Tests/Functional/PhpUninstallTest.php
similarity index 90%
rename from src/Tests/PhpUninstallTest.php
rename to src/Tests/Functional/PhpUninstallTest.php
index d2bc5b0..589271d 100644
--- a/src/Tests/PhpUninstallTest.php
+++ b/src/Tests/Functional/PhpUninstallTest.php
@@ -1,15 +1,15 @@
 <?php
 
-namespace Drupal\php\Tests;
+namespace Drupal\Tests\php\Functional;
 
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Test uninstall functionality of PHP module.
  *
  * @group PHP
  */
-class PhpUninstallTest extends WebTestBase {
+class PhpUninstallTest extends BrowserTestBase {
 
   /**
    * Modules to enable.
-- 
GitLab