1
0
Fork 0
mirror of synced 2024-09-29 08:51:28 +13:00

Fixed webhooks tests - work in progress

This commit is contained in:
Eldad Fux 2021-05-17 12:43:10 +03:00
parent b93a5227b6
commit aee35dbffe

View file

@ -56,10 +56,10 @@ trait WebhooksBase
$this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['$id']);
$this->assertEquals($webhook['data']['name'], 'Actors'); $this->assertEquals($webhook['data']['name'], 'Actors');
$this->assertIsArray($webhook['data']['$permissions']); $this->assertIsArray($webhook['data']['$permissions']);
$this->assertIsArray($webhook['data']['$permissions']['read']); $this->assertIsArray($webhook['data']['$read']);
$this->assertIsArray($webhook['data']['$permissions']['write']); $this->assertIsArray($webhook['data']['$write']);
$this->assertCount(1, $webhook['data']['$permissions']['read']); $this->assertCount(1, $webhook['data']['$read']);
$this->assertCount(1, $webhook['data']['$permissions']['write']); $this->assertCount(1, $webhook['data']['$write']);
$this->assertCount(2, $webhook['data']['rules']); $this->assertCount(2, $webhook['data']['rules']);
return array_merge(['actorsId' => $actors['body']['$id']]); return array_merge(['actorsId' => $actors['body']['$id']]);
@ -99,10 +99,10 @@ trait WebhooksBase
$this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['$id']);
$this->assertEquals($webhook['data']['firstName'], 'Chris'); $this->assertEquals($webhook['data']['firstName'], 'Chris');
$this->assertEquals($webhook['data']['lastName'], 'Evans'); $this->assertEquals($webhook['data']['lastName'], 'Evans');
$this->assertIsArray($webhook['data']['$permissions']['read']); $this->assertIsArray($webhook['data']['$read']);
$this->assertIsArray($webhook['data']['$permissions']['write']); $this->assertIsArray($webhook['data']['$write']);
$this->assertCount(1, $webhook['data']['$permissions']['read']); $this->assertCount(1, $webhook['data']['$read']);
$this->assertCount(1, $webhook['data']['$permissions']['write']); $this->assertCount(1, $webhook['data']['$write']);
$data['documentId'] = $document['body']['$id']; $data['documentId'] = $document['body']['$id'];
@ -142,10 +142,10 @@ trait WebhooksBase
$this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['$id']);
$this->assertEquals($webhook['data']['firstName'], 'Chris1'); $this->assertEquals($webhook['data']['firstName'], 'Chris1');
$this->assertEquals($webhook['data']['lastName'], 'Evans2'); $this->assertEquals($webhook['data']['lastName'], 'Evans2');
$this->assertIsArray($webhook['data']['$permissions']['read']); $this->assertIsArray($webhook['data']['$read']);
$this->assertIsArray($webhook['data']['$permissions']['write']); $this->assertIsArray($webhook['data']['$write']);
$this->assertCount(1, $webhook['data']['$permissions']['read']); $this->assertCount(1, $webhook['data']['$read']);
$this->assertCount(1, $webhook['data']['$permissions']['write']); $this->assertCount(1, $webhook['data']['$write']);
return $data; return $data;
} }
@ -191,10 +191,10 @@ trait WebhooksBase
$this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['$id']);
$this->assertEquals($webhook['data']['firstName'], 'Bradly'); $this->assertEquals($webhook['data']['firstName'], 'Bradly');
$this->assertEquals($webhook['data']['lastName'], 'Cooper'); $this->assertEquals($webhook['data']['lastName'], 'Cooper');
$this->assertIsArray($webhook['data']['$permissions']['read']); $this->assertIsArray($webhook['data']['$read']);
$this->assertIsArray($webhook['data']['$permissions']['write']); $this->assertIsArray($webhook['data']['$write']);
$this->assertCount(1, $webhook['data']['$permissions']['read']); $this->assertCount(1, $webhook['data']['$read']);
$this->assertCount(1, $webhook['data']['$permissions']['write']); $this->assertCount(1, $webhook['data']['$write']);
return $data; return $data;
} }