createUser(['ROLE_DOCTOR']); // gate fires before the session lookup → 403 (not 404) $this->authJson('PATCH', '/api/v1/session/nonexistent-uuid', $doctorUser, ['notes' => 'x']); $this->assertSame(403, $this->responseCode()); } public function testPreRegistrationReturns201(): void { $mobile = '0912' . str_pad((string) random_int(0, 9_999_999), 7, '0', STR_PAD_LEFT); $this->client->request( 'POST', '/api/v1/pre-registration', server: ['CONTENT_TYPE' => 'application/json'], content: json_encode([ 'type' => PreRegistration::TYPE_INDEPENDENT_DOCTOR, 'name' => 'علی محمدی', 'mobile' => $mobile, ]), ); $this->assertSame(201, $this->client->getResponse()->getStatusCode()); } }