Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
RhysLees committed May 29, 2024
1 parent a2a4bb8 commit a7475da
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -23,7 +24,7 @@
]
))->dto();

sleep(5);
Sleep::for(5)->seconds();

$unclip = $this->connector->send(new Unclip(
$fileCabinetId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -23,7 +24,7 @@
]
))->dto();

sleep(5);
Sleep::for(5)->seconds();

$unclip = $this->connector->send(new Unstaple(
$fileCabinetId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
it('can update users', function ($user) {
Event::fake();

sleep(5);
Sleep::for(5)->seconds();

$user->name .= ' - Updated';
$user->active = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
password: 'TESTPASSWORD',
)))->dto();

sleep(5);
Sleep::for(5)->seconds();

$response = $this->connector->send(new AddUserToAGroup(
userId: $user->id,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
password: 'TESTPASSWORD',
)))->dto();

sleep(5);
Sleep::for(5)->seconds();

$response = $this->connector->send(new AddUserToARole(
userId: $user->id,
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit a7475da

Please sign in to comment.