-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Loop,Worker) work around Windows command limit of 8k
- Loading branch information
Showing
7 changed files
with
135 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
|
||
namespace Unit\lucatume\WPBrowser\Process; | ||
|
||
use Codeception\Test\Unit; | ||
use lucatume\WPBrowser\Process\Loop; | ||
|
||
class LoopTest extends Unit | ||
{ | ||
/** | ||
* It should work using normal payloads | ||
* | ||
* @test | ||
*/ | ||
public function should_work_using_normal_payloads(): void | ||
{ | ||
$job = static function () { | ||
return 'Hello from the loop'; | ||
}; | ||
$loop = new Loop([$job]); | ||
$loop->setUseFilePayloads(false); | ||
|
||
$loop->run(); | ||
$results = $loop->getResults(); | ||
|
||
$this->assertEquals('Hello from the loop', $results[0]->getReturnValue()); | ||
} | ||
|
||
/** | ||
* It should work using file payloads | ||
* | ||
* @test | ||
*/ | ||
public function should_work_using_file_payloads(): void | ||
{ | ||
$job = static function () { | ||
return 'Hello from the loop with file payloads'; | ||
}; | ||
$loop = new Loop([$job]); | ||
$loop->setUseFilePayloads(true); | ||
|
||
$loop->run(); | ||
$results = $loop->getResults(); | ||
|
||
$this->assertEquals('Hello from the loop with file payloads', $results[0]->getReturnValue()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters