File tree Expand file tree Collapse file tree 2 files changed +13
-29
lines changed Expand file tree Collapse file tree 2 files changed +13
-29
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace Spatie \WebhookServer \Tests ;
4
-
5
3
use GuzzleHttp \Client ;
6
4
use GuzzleHttp \Exception \ConnectException ;
7
5
use GuzzleHttp \TransferStats ;
@@ -282,8 +280,8 @@ function baseGetRequest(array $overrides = []): array
282
280
artisan ('queue:work --once ' );
283
281
284
282
Event::assertDispatched (WebhookCallFailedEvent::class, function (WebhookCallFailedEvent $ event ) {
285
- $ this -> assertNotNull ($ event ->errorType );
286
- $ this -> assertNotNull ($ event ->errorMessage );
283
+ expect ($ event ->errorType )-> not -> toBeNull ()
284
+ -> and ($ event ->errorMessage )-> not -> toBeNull ( );
287
285
288
286
return true ;
289
287
});
@@ -297,7 +295,7 @@ function baseGetRequest(array $overrides = []): array
297
295
artisan ('queue:work --once ' );
298
296
299
297
Event::assertDispatched (JobFailed::class, function (JobFailed $ event ) {
300
- $ this -> assertInstanceOf (ConnectException::class, $ event -> exception );
298
+ expect ( $ event -> exception )-> toBeInstanceOf (ConnectException::class);
301
299
302
300
return true ;
303
301
});
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace Spatie \WebhookServer \Tests ;
4
-
5
3
use Spatie \WebhookServer \Signer \DefaultSigner ;
6
4
7
- class DefaultSignerTest extends TestCase
8
- {
9
- /** @test */
10
- public function it_can_calculate_a_signature_for_a_given_payload_and_secret ()
11
- {
12
- $ signer = new DefaultSigner ();
5
+ it ('can calculate a signature for a given payload and secret ' , function () {
6
+ $ signer = new DefaultSigner ();
13
7
14
- $ signature = $ signer ->calculateSignature ('https://my.app/webhooks ' , ['a ' => '1 ' ], 'abc ' );
8
+ $ signature = $ signer ->calculateSignature ('https://my.app/webhooks ' , ['a ' => '1 ' ], 'abc ' );
15
9
16
- $ this ->assertEquals (
17
- '345611a3626cf5e080a7a412184001882ab231b8bdb465dc76dbf709f01f210a ' ,
18
- $ signature ,
19
- );
20
- }
10
+ expect ($ signature )->toEqual ('345611a3626cf5e080a7a412184001882ab231b8bdb465dc76dbf709f01f210a ' );
11
+ });
21
12
22
- /** @test */
23
- public function it_can_return_the_name_of_the_signature_header ()
24
- {
25
- $ signer = new DefaultSigner ();
13
+ it ('can return the name of the signature header ' , function () {
14
+ $ signer = new DefaultSigner ();
26
15
27
- $ this ->assertEquals (
28
- config ('webhook-server.signature_header_name ' ),
29
- $ signer ->signatureHeaderName (),
30
- );
31
- }
32
- }
16
+ expect ($ signer ->signatureHeaderName ())
17
+ ->toEqual (config ('webhook-server.signature_header_name ' ));
18
+ });
You can’t perform that action at this time.
0 commit comments