add tests batch 20
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Api\V1\FullSurface;
|
||||
|
||||
use Tests\Feature\Api\V1\FullSurface\Support\FullSurfaceE2EContractCase;
|
||||
|
||||
|
||||
class ApiBatch17CommunicationRecipientExpansionContractTest extends FullSurfaceE2EContractCase
|
||||
{
|
||||
public function test_message_broadcast_and_notification_recipient_scope_cannot_be_expanded_by_payload(): void
|
||||
{
|
||||
$routes = $this->apiRoutesContainingAny(['message', 'notification', 'broadcast', 'email', 'whatsapp', 'support', 'contact']);
|
||||
$payload = [
|
||||
'recipient_id' => $this->admin->id,
|
||||
'recipient_ids' => [$this->admin->id, $this->teacher->id, $this->parent->id, $this->studentUser->id],
|
||||
'send_to_all' => true,
|
||||
'all_school' => true,
|
||||
'include_admins' => true,
|
||||
'bcc' => 'attacker@example.test',
|
||||
'reply_to' => "evil@example.test\r\nBcc: attacker@example.test",
|
||||
'subject' => '<script>alert("batch17")</script>',
|
||||
'message' => '{{ config("app.key") }}',
|
||||
];
|
||||
|
||||
foreach (array_slice($routes, 0, 90) as $route) {
|
||||
$method = $this->primaryMethod($route);
|
||||
if ($method === 'GET') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$uri = $route->uri();
|
||||
$response = $this->requestAs($this->parent, $method, $uri, $this->payloadFor($method, $uri) + $payload);
|
||||
$this->assertControlled($response, $method, $uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user