add tests batch 20
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Api\V1\FullSurface;
|
||||
|
||||
use Tests\Feature\Api\V1\FullSurface\Support\FullSurfaceE2EContractCase;
|
||||
|
||||
|
||||
class ApiBatch19ClassTransferTranscriptContinuityContractTest extends FullSurfaceE2EContractCase
|
||||
{
|
||||
public function test_batch19_class_transfer_transcript_continuity_stays_controlled(): void
|
||||
{
|
||||
$routes = $this->apiRoutesContainingAny(['transfer', 'class', 'classes', 'enrollment', 'students', 'report-card', 'transcript', 'promotion', 'scores']);
|
||||
$payload = [
|
||||
'from_class_section_id' => 999999,
|
||||
'to_class_section_id' => 1,
|
||||
'preserve_scores' => false,
|
||||
'recalculate_transcript' => true,
|
||||
'skip_prerequisites' => true,
|
||||
'force_transfer' => true,
|
||||
'effective_date' => '1900-01-01',
|
||||
];
|
||||
|
||||
foreach (array_slice($routes, 0, 110) as $route) {
|
||||
$method = $this->primaryMethod($route);
|
||||
$uri = $route->uri();
|
||||
$actor = $this->actorFor($uri);
|
||||
|
||||
if (str_contains($uri, 'admin') || str_contains($uri, 'roles') || str_contains($uri, 'permissions') || str_contains($uri, 'backup') || str_contains($uri, 'restore')) {
|
||||
$actor = $this->studentUser;
|
||||
}
|
||||
|
||||
$response = $this->requestAs($actor, $method, $uri, $this->payloadFor($method, $uri) + $payload);
|
||||
$this->assertControlled($response, $method, $uri);
|
||||
$this->assertNotEquals(500, $response->getStatusCode(), $method.' '.$uri.' crashed during Batch 19 class transfer and transcript continuity probe.');
|
||||
|
||||
$body = strtolower($response->getContent());
|
||||
foreach (['sqlstate', 'stack trace', 'app_key', 'remember_token', 'api_token', 'massassignmentexception', 'foreign key constraint', 'database.sqlite'] as $leak) {
|
||||
$this->assertStringNotContainsString($leak, $body, $method.' '.$uri.' leaked '.$leak.' during Batch 19 class transfer and transcript continuity probe.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user