corrige le code de classe (caractères ambigus) et fige l'image Uptime Kuma par digest
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
97c04f1ad6
commit
f899aac48a
11 changed files with 92 additions and 15 deletions
|
|
@ -65,3 +65,9 @@ test("l'inscription échoue si les mots de passe ne correspondent pas", function
|
|||
|
||||
expect(User::count())->toBe(0);
|
||||
});
|
||||
|
||||
test('le code de classe ne contient aucun caractère ambigu (0/O, 1/I/L)', function () {
|
||||
$codes = collect(range(1, 100))->map(fn () => Classe::genererCodeUnique());
|
||||
|
||||
expect($codes->every(fn ($code) => preg_match('/^[ABCDEFGHJKMNPQRSTUVWXYZ23456789]{6}$/', $code) === 1))->toBeTrue();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,11 +11,12 @@ use App\Models\Etablissement;
|
|||
use App\Models\Lab;
|
||||
use App\Models\Seance;
|
||||
use App\Models\User;
|
||||
use App\Support\CodeLisible;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$motDePasse = Str::password(24, symbols: false);
|
||||
$code = Str::upper(Str::random(6));
|
||||
$code = CodeLisible::genere(6);
|
||||
|
||||
$etablissement = Etablissement::create(['nom' => 'Lycée Test Étape 11', 'ville' => 'Test']);
|
||||
$prof = User::create(['name' => 'Prof Test 11', 'email' => 'prof11@syllabus.test', 'password' => $motDePasse, 'etablissement_id' => $etablissement->id]);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ use App\Models\Etablissement;
|
|||
use App\Models\Lab;
|
||||
use App\Models\Seance;
|
||||
use App\Models\User;
|
||||
use App\Support\CodeLisible;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
|
|
@ -19,7 +20,7 @@ $prof = User::create(['name' => 'Prof Visio', 'email' => 'prof-visio@syllabus.te
|
|||
$classe = Classe::create(['etablissement_id' => $etablissement->id, 'user_id' => $prof->id, 'nom' => 'Classe Test Visio', 'formation' => 'Test']);
|
||||
$eleves = [];
|
||||
foreach ([['Lea', 'Martin', 'lea.visio'], ['Yanis', 'Bernard', 'yanis.visio']] as [$prenom, $nom, $identifiant]) {
|
||||
$code = Str::upper(Str::random(6));
|
||||
$code = CodeLisible::genere(6);
|
||||
Eleve::create(['classe_id' => $classe->id, 'prenom' => $prenom, 'nom' => $nom, 'identifiant' => $identifiant, 'code_secret' => Hash::make($code), 'jeton_qr' => Str::random(32)]);
|
||||
$eleves[] = ['identifiant' => $identifiant, 'code' => $code];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue