Skip to content

Commit cf03cc3

Browse files
committed
rename phpunitnodieexception to nodieexception
1 parent 309a605 commit cf03cc3

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

resources/lib/UnitySite.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
namespace UnityWebPortal\lib;
44

55
use phpseclib3\Crypt\PublicKeyLoader;
6-
use UnityWebPortal\lib\exceptions\PhpUnitNoDieException;
6+
use UnityWebPortal\lib\exceptions\NoDieException;
77

88
class UnitySite
99
{
1010
public static function die($x = null, $show_user = false)
1111
{
1212
if (CONFIG["site"]["allow_die"] == false) {
1313
if (is_null($x)) {
14-
throw new PhpUnitNoDieException();
14+
throw new NoDieException();
1515
} else {
16-
throw new PhpUnitNoDieException($x);
16+
throw new NoDieException($x);
1717
}
1818
} else {
1919
if (!is_null($x) and $show_user) {

resources/lib/exceptions/PhpUnitNoDieException.php renamed to resources/lib/exceptions/NoDieException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
namespace UnityWebPortal\lib\exceptions;
44

5-
class PhpUnitNoDieException extends \Exception
5+
class NoDieException extends \Exception
66
{
77
}

test/functional/NewUserTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use PHPUnit\Framework\TestCase;
44
use PHPUnit\Framework\Attributes\DataProvider;
5-
use UnityWebPortal\lib\exceptions\PhpUnitNoDieException;
65
use UnityWebPortal\lib\UnityGroup;
76
use UnityWebPortal\lib\UnityOrg;
87
use UnityWebPortal\lib\UnitySQL;

test/functional/ViewAsUserTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use UnityWebPortal\lib\UnitySite;
4-
use UnityWebPortal\lib\exceptions\PhpUnitNoDieException;
54
use PHPUnit\Framework\TestCase;
65

76
class ViewAsUserTest extends TestCase

test/phpunit-bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
require_once __DIR__ . "/../resources/lib/UnityWebhook.php";
1616
require_once __DIR__ . "/../resources/lib/UnityRedis.php";
1717
require_once __DIR__ . "/../resources/lib/UnityGithub.php";
18-
require_once __DIR__ . "/../resources/lib/exceptions/PhpUnitNoDieException.php";
18+
require_once __DIR__ . "/../resources/lib/exceptions/NoDieException.php";
1919
require_once __DIR__ . "/../resources/lib/exceptions/SSOException.php";
2020

2121
$_SERVER["HTTP_HOST"] = "phpunit"; // used for config override
@@ -91,7 +91,7 @@ function http_post(string $phpfile, array $post_data): void
9191
$post_did_redirect_or_die = false;
9292
try {
9393
include $phpfile;
94-
} catch (UnityWebPortal\lib\exceptions\PhpUnitNoDieException $e) {
94+
} catch (UnityWebPortal\lib\exceptions\NoDieException $e) {
9595
$post_did_redirect_or_die = true;
9696
} finally {
9797
ob_get_clean(); // discard output

test/unit/UnitySiteTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use PHPUnit\Framework\TestCase;
66
use PHPUnit\Framework\Attributes\DataProvider;
7-
use UnityWebPortal\lib\exceptions\PhpUnitNoDieException;
7+
use UnityWebPortal\lib\exceptions\NoDieException;
88
// use PHPUnit\Framework\Attributes\BackupGlobals;
99
// use PHPUnit\Framework\Attributes\RunTestsInSeparateProcess;
1010

@@ -108,15 +108,15 @@ public function testArrayGetOrBadRequestReturnsArrayWhenTraversingPartially()
108108
public function testArrayGetOrBadRequestThrowsOnMissingKeyFirstLevel()
109109
{
110110
$array = ["x" => 1];
111-
$this->expectException(PhpUnitNoDieException::class);
111+
$this->expectException(NoDieException::class);
112112
$this->expectExceptionMessage('["y"]');
113113
UnitySite::arrayGetOrBadRequest($array, "y");
114114
}
115115

116116
public function testArrayGetOrBadRequestThrowsOnMissingKeyNested()
117117
{
118118
$array = ["a" => []];
119-
$this->expectException(PhpUnitNoDieException::class);
119+
$this->expectException(NoDieException::class);
120120
// Should include both levels
121121
$this->expectExceptionMessage('["a","b"]');
122122
UnitySite::arrayGetOrBadRequest($array, "a", "b");
@@ -125,7 +125,7 @@ public function testArrayGetOrBadRequestThrowsOnMissingKeyNested()
125125
public function testArrayGetOrBadRequestThrowsWhenValueIsNullButKeyNotSet()
126126
{
127127
$array = ["a" => null];
128-
$this->expectException(PhpUnitNoDieException::class);
128+
$this->expectException(NoDieException::class);
129129
$this->expectExceptionMessage('["a"]');
130130
UnitySite::arrayGetOrBadRequest($array, "a");
131131
}

0 commit comments

Comments
 (0)