Skip to content

Commit

Permalink
refactor(tests): adjust exception to use pest syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mallardduck committed Dec 2, 2022
1 parent b7c37f8 commit 56df293
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tests/ExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,23 @@
it('will throw an exception for empty input using IANA', function () {
$ianaLocator = new IanaServerLocator();
expect($ianaLocator)->toBeObject()->toBeInstanceOf(IanaServerLocator::class);
$this->expectException(MissingArgument::class);
$ianaLocator->getWhoisServer('');
});
})->throws(MissingArgument::class);

it('will throw an exception for a fake TLD using IANA', function () {
$ianaLocator = new IanaServerLocator();
expect($ianaLocator)->toBeObject()->toBeInstanceOf(IanaServerLocator::class);
$this->expectException(UnknownTopLevelDomain::class);
$ianaLocator->getWhoisServer('bebop');
});
})->throws(UnknownTopLevelDomain::class);

it('will throw an exception for empty input using PSL', function () {
$pslLocator = new PslServerLocator();
expect($pslLocator)->toBeObject()->toBeInstanceOf(PslServerLocator::class);
$this->expectException(MissingArgument::class);
$pslLocator->getWhoisServer('');
});
})->throws(MissingArgument::class);

it('will throw an exception for a fake TLD using PSL', function () {
$pslLocator = new PslServerLocator();
expect($pslLocator)->toBeObject()->toBeInstanceOf(PslServerLocator::class);
$this->expectException(UnknownTopLevelDomain::class);
$pslLocator->getWhoisServer('bebop');
});
})->throws(UnknownTopLevelDomain::class);

0 comments on commit 56df293

Please sign in to comment.