|
|
|
|
@ -99,12 +99,15 @@ $assert(str_contains($sources['routes'], "'/profile'")
|
|
|
|
|
&& str_contains($sources['account'], 'AdminCsrf::verify')
|
|
|
|
|
&& str_contains($sources['account'], 'UserProfileService::update'),
|
|
|
|
|
'The authenticated CSRF-protected profile API is not fully wired.');
|
|
|
|
|
$assert(str_contains($sources['auth'], 'UserProfileService::validate($profileInput)')
|
|
|
|
|
&& str_contains($sources['auth'], 'foreach ($profile as $field => $value)'),
|
|
|
|
|
'Registration does not validate and persist the shared profile payload.');
|
|
|
|
|
$assert(!str_contains($sources['auth'], 'UserProfileService')
|
|
|
|
|
&& !str_contains($sources['register'], 'registrationProfileTitle')
|
|
|
|
|
&& str_contains($sources['register'], "email: fieldValue('email')")
|
|
|
|
|
&& str_contains($sources['register'], "name: fieldValue('name')"),
|
|
|
|
|
'Registration must keep its original fields and must not collect account profile data.');
|
|
|
|
|
$assert(str_contains($sources['drawer'], 'id="vuProfileForm"')
|
|
|
|
|
&& str_contains($sources['runtime'], 'post("/user/profile", profile)'),
|
|
|
|
|
'The account information form is not wired to its profile API.');
|
|
|
|
|
&& str_contains($sources['runtime'], 'post("/user/profile", profile)')
|
|
|
|
|
&& preg_match('/<details\b[^>]*\bopen\b/i', $sources['drawer']) !== 1,
|
|
|
|
|
'The account information form is not wired correctly or a drawer card is open by default.');
|
|
|
|
|
|
|
|
|
|
$assert(preg_match('/CREATE TABLE `user` \((.*?)\) ENGINE=/s', $sources['schema'], $userTable) === 1,
|
|
|
|
|
'The fresh user table definition is missing.');
|
|
|
|
|
@ -122,10 +125,10 @@ foreach (UserProfileService::FIELDS as $field) {
|
|
|
|
|
$assert(str_contains($userTable[1], '`' . $field . '` ' . $columnDefinitions[$field])
|
|
|
|
|
&& str_contains($sources['migration'], '`' . $field . '`'),
|
|
|
|
|
'The user table schema is missing the profile column: ' . $field);
|
|
|
|
|
$assert(str_contains($sources['register'], 'name="' . $field . '"')
|
|
|
|
|
&& str_contains($sources['register'], $field . ": fieldValue('" . $field . "')")
|
|
|
|
|
$assert(!str_contains($sources['register'], 'name="' . $field . '"')
|
|
|
|
|
&& !str_contains($sources['register'], $field . ": fieldValue('" . $field . "')")
|
|
|
|
|
&& str_contains($sources['drawer'], 'name="' . $field . '"'),
|
|
|
|
|
'A registration or account profile field is missing: ' . $field);
|
|
|
|
|
'Profile data must be editable in account settings without appearing during registration: ' . $field);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "User registration and account profile checks passed.\n";
|
|
|
|
|
echo "User account profile and registration separation checks passed.\n";
|
|
|
|
|
|