- $this->assertTrue(boolval($child->hasPermissions()), 'Child book should now be restricted');
- $this->assertTrue($child->permissions()->count() === 2, 'Child book should have copied permissions');
- $this->assertDatabaseHas('entity_permissions', ['restrictable_id' => $child->id, 'action' => 'view', 'role_id' => $editorRole->id]);
- $this->assertDatabaseHas('entity_permissions', ['restrictable_id' => $child->id, 'action' => 'update', 'role_id' => $editorRole->id]);
+ $this->assertTrue($child->hasPermissions(), 'Child book should now be restricted');
+ $this->assertEquals(2, $child->permissions()->count(), 'Child book should have copied permissions');
+ $this->assertDatabaseHas('entity_permissions', [
+ 'entity_type' => 'book',
+ 'entity_id' => $child->id,
+ 'role_id' => $editorRole->id,
+ 'view' => true, 'update' => true, 'create' => false, 'delete' => false,
+ ]);