Skip to content

Commit

Permalink
Fix deprecated calls in test (#187)
Browse files Browse the repository at this point in the history
Signed-off-by: Lloric Mayuga Garcia <[email protected]>
  • Loading branch information
lloricode authored Mar 25, 2024
1 parent e28b1a4 commit 61f0da7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/DownloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
});

it('throws an exception for non existing host')
->tap(fn () => Downloader::downloadCertificateFromUrl('spatie-non-existing.be'))
->defer(fn () => Downloader::downloadCertificateFromUrl('spatie-non-existing.be'))
->throws(HostDoesNotExist::class);

it('throws an exception when downloading a certificate from a host that contains none')
->tap(fn () => Downloader::downloadCertificateFromUrl('3564020356.org'))
->defer(fn () => Downloader::downloadCertificateFromUrl('3564020356.org'))
->throws(UnknownError::class);

it('throws an exception when downloading a certificate for a missing host name from an ip address', function () {
Expand Down
4 changes: 2 additions & 2 deletions tests/SslCertificateFromFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
});

it('can load pem certificate')
->tap(fn () => $this->certificate = SslCertificate::createFromFile(__DIR__ . '/stubs/spatieCertificate.pem'))
->defer(fn () => $this->certificate = SslCertificate::createFromFile(__DIR__ . '/stubs/spatieCertificate.pem'))
->expect(fn () => $this->certificate->getOrganization())->toEqual("Let's Encrypt")
->and(fn () => $this->certificate->getDomain())->toEqual("analytics.spatie.be");

it('can load der certificate')
->tap(fn () => $this->certificate = SslCertificate::createFromFile(__DIR__ . '/stubs/derCertificate.der'))
->defer(fn () => $this->certificate = SslCertificate::createFromFile(__DIR__ . '/stubs/derCertificate.der'))
->expect(fn () => $this->certificate->getOrganization())->toEqual("Let's Encrypt")
->and(fn () => $this->certificate->getDomain())->toEqual("analytics.spatie.be");
2 changes: 1 addition & 1 deletion tests/UrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
});

it('throws an exception when creating an url from an empty string')
->tap(fn () => new Url(''))
->defer(fn () => new Url(''))
->throws(InvalidUrl::class);

it('can assume a default port when not explicitly defined', function () {
Expand Down

0 comments on commit 61f0da7

Please sign in to comment.