From 865fd6405d69cb95896d33f5a5300c70586289f3 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 18 Oct 2017 11:35:49 +0200 Subject: [PATCH] Move sanity check to a pre-condition check --- api/src/test/LoggedInTest.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/api/src/test/LoggedInTest.php b/api/src/test/LoggedInTest.php index 739b54d57c..b6225034c9 100644 --- a/api/src/test/LoggedInTest.php +++ b/api/src/test/LoggedInTest.php @@ -17,7 +17,6 @@ namespace EGroupware\Api; require_once realpath(__DIR__.'/../loader/common.php'); // autoloader & check_load_extension use PHPUnit\Framework\TestCase as TestCase; -use PHPUnit\Framework\ExpectationFailedException as PHPUnitException; use EGroupware\Api; /** @@ -63,16 +62,16 @@ abstract class LoggedInTest extends TestCase static::markTestSkipped('Unable to connect to Egroupware - ' . $e->getMessage()); return; } + } + public function assertPreConditions() + { // Do some checks to make sure things we expect are there - if(!static::sanity_check()) - { - throw new PHPUnitException('Unable to connect to Egroupware - failed sanity check'); - } + $this->assertTrue(static::sanity_check(), 'Unable to connect to Egroupware - failed sanity check'); } /** - * End session when done - every test case gets its own session + * End session when done - every test class gets its own session */ public static function tearDownAfterClass() {