diff --git a/src/Util/Bitmap.php b/src/Util/Bitmap.php index 1d5956dde2..ab8c2a3385 100644 --- a/src/Util/Bitmap.php +++ b/src/Util/Bitmap.php @@ -19,6 +19,7 @@ namespace App\Util; +use App\Core\Log; use App\Util\Exception\ServerException; abstract class Bitmap diff --git a/tests/Util/BitmapTest.php b/tests/Util/BitmapTest.php index 2178df2b5d..0ce7e1c8c1 100644 --- a/tests/Util/BitmapTest.php +++ b/tests/Util/BitmapTest.php @@ -19,6 +19,8 @@ namespace App\Tests\Util; +use App\Util\Exception\ServerException; +use Jchook\AssertThrows\AssertThrows; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; class FooBitmap extends \App\Util\Bitmap @@ -35,8 +37,15 @@ class BarBitmap extends \App\Util\Bitmap public const PREFIX = 'BAR_'; } +class QuuxBitmap extends \App\Util\Bitmap +{ + public const HELIUM = 2; +} + class BitmapTest extends KernelTestCase { + use AssertThrows; + public function testObj() { $a = FooBitmap::create(FooBitmap::FOO | FooBitmap::BAR); @@ -56,4 +65,9 @@ class BitmapTest extends KernelTestCase $b = BarBitmap::toArray(BarBitmap::HYDROGEN | BarBitmap::HELIUM); static::assertSame(['BAR_HYDROGEN', 'BAR_HELIUM'], $b); } + + public function testThrows() + { + static::assertThrows(ServerException::class, fn () => QuuxBitmap::create(1)); + } }