diff --git a/tests/Pest/MoneyTest.php b/tests/Pest/MoneyTest.php index 964be4a..f895818 100644 --- a/tests/Pest/MoneyTest.php +++ b/tests/Pest/MoneyTest.php @@ -11,8 +11,8 @@ test('Money value is immutable', function () { try { $money->value = 200; - } catch (Error $th) { - expect($th->getMessage())->toStartWith('Cannot access protected property'); + } catch (Throwable $th) { + expect($th)->toBeInstanceOf(Error::class); } }); @@ -21,8 +21,8 @@ test('Money currency is immutable', function () { try { $money->currency = 'EUR'; - } catch (Error $th) { - expect($th->getMessage())->toStartWith('Cannot access protected property'); + } catch (Throwable $th) { + expect($th)->toBeInstanceOf(Error::class); } });