diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php index f994a5e..9fbbbdc 100644 --- a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php +++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/StapleTest.php @@ -4,6 +4,7 @@ use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Staple; use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetASpecificDocumentFromAFileCabinet; use Illuminate\Support\Facades\Event; +use Illuminate\Support\Sleep; it('can staple 2 documents', function () { Event::fake(); @@ -23,7 +24,7 @@ ] ))->dto(); - sleep(5); // Wait for the files to be uploaded and processed + Sleep::for(5)->seconds(); // Wait for the files to be uploaded and processed $stapledDocument = $this->connector->send(new GetASpecificDocumentFromAFileCabinet( $fileCabinetId, diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php index f6cbcdc..21c5c18 100644 --- a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php +++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnclipTest.php @@ -4,6 +4,7 @@ use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Clip; use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Unclip; use Illuminate\Support\Facades\Event; +use Illuminate\Support\Sleep; it('can unclip 2 documents', function () { Event::fake(); @@ -23,7 +24,7 @@ ] ))->dto(); - sleep(5); + Sleep::for(5)->seconds(); $unclip = $this->connector->send(new Unclip( $fileCabinetId, diff --git a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php index 1bd30b6..8d53a3c 100644 --- a/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php +++ b/tests/Feature/Requests/Documents/ClipUnclipStapleUnstaple/UnstapleTest.php @@ -4,6 +4,7 @@ use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Staple; use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Unstaple; use Illuminate\Support\Facades\Event; +use Illuminate\Support\Sleep; it('can unstaple a document', function () { Event::fake(); @@ -23,7 +24,7 @@ ] ))->dto(); - sleep(5); + Sleep::for(5)->seconds(); $unclip = $this->connector->send(new Unstaple( $fileCabinetId, diff --git a/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php b/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php index f61a8f0..e35f5fe 100644 --- a/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php +++ b/tests/Feature/Requests/General/UserManagement/CreateUpdateUsers/CreateUpdateUserTest.php @@ -30,7 +30,7 @@ it('can update users', function ($user) { Event::fake(); - sleep(5); + Sleep::for(5)->seconds(); $user->name .= ' - Updated'; $user->active = false; diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php index 22e093e..8826df2 100644 --- a/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php +++ b/tests/Feature/Requests/General/UserManagement/GetModifyGroups/AddRemoveUserToAGroupTest.php @@ -20,7 +20,7 @@ password: 'TESTPASSWORD', )))->dto(); - sleep(5); + Sleep::for(5)->seconds(); $response = $this->connector->send(new AddUserToAGroup( userId: $user->id, @@ -39,7 +39,7 @@ it('can remove groups to a user', function ($user) { Event::fake(); - sleep(5); + Sleep::for(5)->seconds(); $response = $this->connector->send(new RemoveUserFromAGroup( userId: $user->id, diff --git a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php index 4f89916..bcd6c6b 100644 --- a/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php +++ b/tests/Feature/Requests/General/UserManagement/GetModifyRoles/AddRemoveUserToARoleTest.php @@ -20,7 +20,7 @@ password: 'TESTPASSWORD', )))->dto(); - sleep(5); + Sleep::for(5)->seconds(); $response = $this->connector->send(new AddUserToARole( userId: $user->id, @@ -39,7 +39,7 @@ it('can remove roles to a user', function ($user) { Event::fake(); - sleep(5); + Sleep::for(5)->seconds(); $response = $this->connector->send(new RemoveUserFromARole( userId: $user->id, diff --git a/tests/Pest.php b/tests/Pest.php index a0917b4..9b18f40 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -9,6 +9,7 @@ use CodebarAg\DocuWare\Requests\General\UserManagement\CreateUpdateUsers\UpdateUser; use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsers; use CodebarAg\DocuWare\Tests\TestCase; +use Illuminate\Support\Sleep; uses(TestCase::class) ->in(__DIR__); @@ -96,7 +97,7 @@ function uploadFiles($connector, $fileCabinetId, $path): array 'test-2.pdf', ))->dto(); - sleep(5); // Wait for the files to be uploaded and processed + Sleep::for(5)->seconds(); // Wait for the files to be uploaded and processed // Have to get document again as returned data is incorrect $document = $connector->send(new GetASpecificDocumentFromAFileCabinet(