diff --git a/tests/Pest.php b/tests/Pest.php index 46ef170..9a6a482 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -4,8 +4,3 @@ use ArchTech\Money\Tests\TestCase; use Pest\TestSuite; uses(ArchTech\Money\Tests\TestCase::class)->in('Pest'); - -function pest(): TestCase -{ - return TestSuite::getInstance()->test; -} diff --git a/tests/Pest/CurrencyTest.php b/tests/Pest/CurrencyTest.php index 4d917bd..1fbea1e 100644 --- a/tests/Pest/CurrencyTest.php +++ b/tests/Pest/CurrencyTest.php @@ -5,13 +5,13 @@ use ArchTech\Money\Exceptions\InvalidCurrencyException; use ArchTech\Money\Tests\Currencies\CZK; test("a currency is invalid if it doesn't have a name", function () { - pest()->expectException(InvalidCurrencyException::class); + $this->expectException(InvalidCurrencyException::class); new Currency(rate: 2.0, code: 'CZK'); }); test("a currency is invalid if it doesn't have a code", function () { - pest()->expectException(InvalidCurrencyException::class); + $this->expectException(InvalidCurrencyException::class); new Currency(rate: 2.0, name: 'Czech Crown'); }); diff --git a/tests/Pest/MoneyTest.php b/tests/Pest/MoneyTest.php index f895818..4749196 100644 --- a/tests/Pest/MoneyTest.php +++ b/tests/Pest/MoneyTest.php @@ -170,7 +170,7 @@ test('an exception is thrown if none of the currencies match the prefix and suff currencies()->remove(USD::class); - pest()->expectException(CannotExtractCurrencyException::class); + $this->expectException(CannotExtractCurrencyException::class); Money::fromFormatted($formatted); }); @@ -178,7 +178,7 @@ test('an exception is thrown if multiple currencies are using the same prefix an currencies()->add(['code' => 'USD2', 'name' => 'USD2', 'prefix' => '$']); $money = money(1000); - pest()->expectException(CannotExtractCurrencyException::class); + $this->expectException(CannotExtractCurrencyException::class); Money::fromFormatted($money->formatted()); });