Skip to content

Commit

Permalink
Prepare migration to foundry 2
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminjonard committed Jun 8, 2024
1 parent 3ffde32 commit f95483b
Show file tree
Hide file tree
Showing 100 changed files with 915 additions and 1,371 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
],
"test:phpunit": [
"Composer\\Config::disableProcessTimeout",
"./vendor/phpunit/phpunit/phpunit"
"./vendor/phpunit/phpunit/phpunit --display-deprecations"
],
"test:paratest": [
"Composer\\Config::disableProcessTimeout",
Expand Down
32 changes: 16 additions & 16 deletions tests/Api/Album/AlbumApiNotOwnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class AlbumApiNotOwnerTest extends ApiTestCase
public function test_cant_get_another_user_album(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$owner = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$owner = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['owner' => $owner]);

// Act
Expand All @@ -36,8 +36,8 @@ public function test_cant_get_another_user_album(): void
public function test_cant_get_another_user_album_children(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$owner = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$owner = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['owner' => $owner]);
AlbumFactory::createMany(3, ['parent' => $album, 'owner' => $owner]);

Expand All @@ -55,8 +55,8 @@ public function test_cant_get_another_user_album_children(): void
public function test_cant_get_another_user_album_parent(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$owner = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$owner = UserFactory::createOne()->_real();
$parent = AlbumFactory::createOne(['owner' => $owner]);
$album = AlbumFactory::createOne(['parent' => $parent, 'owner' => $owner]);

Expand All @@ -70,8 +70,8 @@ public function test_cant_get_another_user_album_parent(): void
public function test_cant_get_another_user_album_photos(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$owner = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$owner = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['owner' => $owner]);
PhotoFactory::createMany(3, ['album' => $album, 'owner' => $owner]);

Expand All @@ -89,8 +89,8 @@ public function test_cant_get_another_user_album_photos(): void
public function test_cant_post_album_in_another_user_album(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$owner = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$owner = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['owner' => $owner]);

// Act
Expand All @@ -105,8 +105,8 @@ public function test_cant_post_album_in_another_user_album(): void
public function test_cant_put_another_user_album(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$owner = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$owner = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['title' => 'Frieren', 'owner' => $owner]);

// Act
Expand All @@ -121,8 +121,8 @@ public function test_cant_put_another_user_album(): void
public function test_cant_patch_another_user_album(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$owner = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$owner = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['title' => 'Frieren', 'owner' => $owner]);

// Act
Expand All @@ -140,8 +140,8 @@ public function test_cant_patch_another_user_album(): void
public function test_cant_delete_another_user_album(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$owner = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$owner = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['owner' => $owner]);

// Act
Expand Down
26 changes: 13 additions & 13 deletions tests/Api/Album/AlbumApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AlbumApiTest extends ApiTestCase
public function test_get_albums(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
AlbumFactory::createMany(3, ['owner' => $user]);

// Act
Expand All @@ -39,7 +39,7 @@ public function test_get_albums(): void
public function test_get_album(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['owner' => $user]);

// Act
Expand All @@ -56,7 +56,7 @@ public function test_get_album(): void
public function test_get_album_children(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['owner' => $user]);
AlbumFactory::createMany(3, ['parent' => $album, 'owner' => $user]);

Expand All @@ -74,7 +74,7 @@ public function test_get_album_children(): void
public function test_get_album_parent(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$parentAlbum = AlbumFactory::createOne(['owner' => $user]);
$album = AlbumFactory::createOne(['parent' => $parentAlbum, 'owner' => $user]);

Expand All @@ -92,7 +92,7 @@ public function test_get_album_parent(): void
public function test_get_album_photos(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['owner' => $user]);
PhotoFactory::createMany(3, ['album' => $album, 'owner' => $user]);

Expand All @@ -110,7 +110,7 @@ public function test_get_album_photos(): void
public function test_post_album(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();

// Act
$this->createClientWithCredentials($user)->request('POST', '/api/albums', ['json' => [
Expand All @@ -128,7 +128,7 @@ public function test_post_album(): void
public function test_put_album(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['title' => 'Frieren', 'owner' => $user]);

// Act
Expand All @@ -148,7 +148,7 @@ public function test_put_album(): void
public function test_cant_assign_album_as_its_own_parent(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['title' => 'Frieren', 'owner' => $user]);

// Act
Expand All @@ -163,7 +163,7 @@ public function test_cant_assign_album_as_its_own_parent(): void
public function test_cant_assign_child_as_parent_album(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['title' => 'Frieren', 'owner' => $user]);
$child = AlbumFactory::createOne(['parent' => $album, 'title' => 'Ex-libris', 'owner' => $user]);

Expand All @@ -179,7 +179,7 @@ public function test_cant_assign_child_as_parent_album(): void
public function test_patch_album(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['title' => 'Frieren', 'owner' => $user]);

// Act
Expand All @@ -202,7 +202,7 @@ public function test_patch_album(): void
public function test_delete_album(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['owner' => $user]);

// Act
Expand All @@ -215,7 +215,7 @@ public function test_delete_album(): void
public function test_post_album_image(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$album = AlbumFactory::createOne(['owner' => $user]);
$uploadedFile = $this->createFile('png');

Expand All @@ -239,7 +239,7 @@ public function test_post_album_image(): void
public function test_delete_album_image(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$uploadedFile = $this->createFile('png');
$imagePath = $uploadedFile->getRealPath();
$album = AlbumFactory::createOne(['owner' => $user, 'image' => $imagePath]);
Expand Down
16 changes: 8 additions & 8 deletions tests/Api/ChoiceList/ChoiceListApiNotOwnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class ChoiceListApiNotOwnerTest extends ApiTestCase
public function test_cant_get_another_user_choice_list(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$owner = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$owner = UserFactory::createOne()->_real();
$choiceList = ChoiceListFactory::createOne(['owner' => $owner]);

// Act
Expand All @@ -33,8 +33,8 @@ public function test_cant_get_another_user_choice_list(): void
public function test_cant_put_another_user_choice_list(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$owner = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$owner = UserFactory::createOne()->_real();
$choiceList = ChoiceListFactory::createOne(['name' => 'Progress', 'owner' => $owner]);

// Act
Expand All @@ -49,8 +49,8 @@ public function test_cant_put_another_user_choice_list(): void
public function test_cant_patch_another_user_choice_list(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$owner = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$owner = UserFactory::createOne()->_real();
$choiceList = ChoiceListFactory::createOne(['name' => 'Progress', 'owner' => $owner]);

// Act
Expand All @@ -68,8 +68,8 @@ public function test_cant_patch_another_user_choice_list(): void
public function test_cant_delete_another_user_choice_list(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$owner = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$owner = UserFactory::createOne()->_real();
$choiceList = ChoiceListFactory::createOne(['name' => 'Progress', 'owner' => $owner]);

// Act
Expand Down
12 changes: 6 additions & 6 deletions tests/Api/ChoiceList/ChoiceListApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ChoiceListApiTest extends ApiTestCase
public function test_get_choice_lists(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
ChoiceListFactory::createMany(3, ['owner' => $user]);

// Act
Expand All @@ -37,7 +37,7 @@ public function test_get_choice_lists(): void
public function test_get_choice_list(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$choiceList = ChoiceListFactory::createOne(['owner' => $user]);

// Act
Expand All @@ -54,7 +54,7 @@ public function test_get_choice_list(): void
public function test_post_choice_list(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();

// Act
$this->createClientWithCredentials($user)->request('POST', '/api/choice_lists', ['json' => [
Expand All @@ -74,7 +74,7 @@ public function test_post_choice_list(): void
public function test_put_choice_list(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$choiceList = ChoiceListFactory::createOne(['name' => 'Progress', 'choices' => ['New', 'In progress', 'Done'], 'owner' => $user]);

// Act
Expand All @@ -96,7 +96,7 @@ public function test_put_choice_list(): void
public function test_patch_choice_list(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$choiceList = ChoiceListFactory::createOne(['name' => 'Progress', 'choices' => ['New', 'In progress', 'Done'], 'owner' => $user]);

// Act
Expand All @@ -120,7 +120,7 @@ public function test_patch_choice_list(): void
public function test_delete_choice_list(): void
{
// Arrange
$user = UserFactory::createOne()->object();
$user = UserFactory::createOne()->_real();
$choiceList = ChoiceListFactory::createOne(['owner' => $user]);

// Act
Expand Down
Loading

0 comments on commit f95483b

Please sign in to comment.