[FIX] [BUG] Impossible d'ajouter un morceau #4

This commit is contained in:
NADAL Jean-Baptiste
2026-02-26 17:51:13 +01:00
parent 9c6d3fec16
commit 96628ef4b8
4 changed files with 44 additions and 8 deletions

View File

@@ -175,6 +175,14 @@ class APITest {
public function testCreateScoreWithPieces() {
$this->section("Create Score with Pieces - Functional");
// Test 0: Try to create score with existing ID should fail
$result = $this->request('POST', 'admin/scores', [
'name' => 'Test Duplicate',
'compositor' => 'Test',
'id' => '001'
]);
$this->test('Create with existing ID returns error', $result['code'] === 400 && isset($result['body']['error']));
// Test 1: Create score with 2 pieces
$testName = 'Test Score ' . date('YmdHis');
$result = $this->request('POST', 'admin/scores', [