Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Jan 18, 2025
1 parent 64c8c4d commit e0a69a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app/Http/Requests/Maintenance/FullTreeUpdateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use App\Http\Requests\BaseApiRequest;
use App\Models\Configs;
use App\Policies\SettingsPolicy;
use App\Rules\AlbumIDRule;
use App\Rules\RandomIDRule;
use Illuminate\Support\Facades\Gate;

class FullTreeUpdateRequest extends BaseApiRequest
Expand All @@ -34,10 +34,10 @@ public function rules(): array
return [
'albums' => 'required|array|min:1',
'albums.*' => 'required|array',
'albums.*.id' => ['required', new AlbumIDRule(false)],
'albums.*.id' => ['required', new RandomIDRule(false)],
'albums.*._lft' => 'required|integer|min:1',
'albums.*._rgt' => 'required|integer|min:1',
'albums.*.parent_id' => [new AlbumIDRule(true)],
'albums.*.parent_id' => [new RandomIDRule(true)],
];
}

Expand Down
1 change: 1 addition & 0 deletions tests/Feature_v2/Maintenance/CleaningTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

namespace Tests\Feature_v2\Maintenance;

use function Safe\mkdir;
use function Safe\touch;
use Tests\Feature_v2\Base\BaseApiV2Test;

Expand Down
8 changes: 4 additions & 4 deletions tests/Feature_v2/Maintenance/FullTreeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public function testGuest(): void
$response = $this->postJson('Maintenance::fullTree', []);
$this->assertUnprocessable($response);

$response = $this->putJson('Maintenance::fullTree', [
$response = $this->postJson('Maintenance::fullTree', [
'albums' => [
[
'id' => '1',
'id' => '123456789012345678901234',
'_lft' => 1,
'_rgt' => 2,
'parent_id' => null,
Expand All @@ -51,10 +51,10 @@ public function testUser(): void
$response = $this->actingAs($this->userLocked)->postJson('Maintenance::fullTree', []);
$this->assertUnprocessable($response);

$response = $this->actingAs($this->userLocked)->putJson('Maintenance::fullTree', [
$response = $this->actingAs($this->userLocked)->postJson('Maintenance::fullTree', [
'albums' => [
[
'id' => '1',
'id' => '123456789012345678901234',
'_lft' => 1,
'_rgt' => 2,
'parent_id' => null,
Expand Down

0 comments on commit e0a69a5

Please sign in to comment.