From 6eaaa30b4f013f4865b58aeb8f5877cac734986c Mon Sep 17 00:00:00 2001
From: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Date: Sun, 6 Dec 2015 14:45:51 +0100
Subject: [PATCH] [TASK] Allow calling tests with phpdbg-SAPI

Using phpdbg with phpunit it a fast way to create code-coverage-reports.

Change-Id: If3a1b2f957af6937d0191b4d9a1e656aac5373a7
Resolves: #72076
Releases: master
Reviewed-on: https://review.typo3.org/45157
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 typo3/sysext/core/Build/FunctionalTestsBootstrap.php | 2 +-
 typo3/sysext/core/Build/UnitTestsBootstrap.php       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/typo3/sysext/core/Build/FunctionalTestsBootstrap.php b/typo3/sysext/core/Build/FunctionalTestsBootstrap.php
index f7d578707e71..ef9361040781 100644
--- a/typo3/sysext/core/Build/FunctionalTestsBootstrap.php
+++ b/typo3/sysext/core/Build/FunctionalTestsBootstrap.php
@@ -19,7 +19,7 @@
  */
 call_user_func(function () {
     // Ensure cli only as security measure
-    if (PHP_SAPI !== 'cli') {
+    if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') {
         die('This script supports command line usage only. Please check your command.');
     }
 
diff --git a/typo3/sysext/core/Build/UnitTestsBootstrap.php b/typo3/sysext/core/Build/UnitTestsBootstrap.php
index ed129a1c9d97..9f43e475900c 100644
--- a/typo3/sysext/core/Build/UnitTestsBootstrap.php
+++ b/typo3/sysext/core/Build/UnitTestsBootstrap.php
@@ -28,7 +28,7 @@
  */
 call_user_func(function () {
     // Ensure cli only as security measure
-    if (PHP_SAPI !== 'cli') {
+    if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') {
         die('This script supports command line usage only. Please check your command.');
     }
 
-- 
GitLab