2020-10-09 18:19:35 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Tests\unit\workflow\engine\classes;
|
|
|
|
|
|
|
|
|
|
use Tests\TestCase;
|
|
|
|
|
use WorkspaceTools;
|
|
|
|
|
|
|
|
|
|
class WorkflowToolsTest extends TestCase
|
|
|
|
|
{
|
|
|
|
|
private $workspaceTools;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Method set up.
|
|
|
|
|
*/
|
2022-06-09 11:43:56 -04:00
|
|
|
public function setUp(): void
|
2020-10-09 18:19:35 -04:00
|
|
|
{
|
|
|
|
|
parent::setUp();
|
|
|
|
|
$this->workspaceTools = new WorkspaceTools('workflow');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Method tear down.
|
|
|
|
|
*/
|
2022-06-09 11:43:56 -04:00
|
|
|
public function tearDown(): void
|
2020-10-09 18:19:35 -04:00
|
|
|
{
|
|
|
|
|
parent::tearDown();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This test the addAsyncOptionToSchedulerCommands method.
|
|
|
|
|
* @test
|
|
|
|
|
* @covers \WorkspaceTools::addAsyncOptionToSchedulerCommands()
|
|
|
|
|
*/
|
|
|
|
|
public function it_should_test_addAsyncOptionToSchedulerCommands_method()
|
|
|
|
|
{
|
2020-10-13 13:17:21 -04:00
|
|
|
//method "WorkspaceTools::initPropel(true)" crashes all connections
|
2022-07-21 00:04:21 -04:00
|
|
|
$this->markTestSkipped("WorkspaceTools::initPropel(true) crashes all connections");
|
2020-10-13 13:17:21 -04:00
|
|
|
|
2020-10-09 18:19:35 -04:00
|
|
|
ob_start();
|
|
|
|
|
$this->workspaceTools->addAsyncOptionToSchedulerCommands(false);
|
|
|
|
|
$string = ob_get_clean();
|
|
|
|
|
$this->assertRegExp("/This was previously updated/", $string);
|
|
|
|
|
|
|
|
|
|
ob_start();
|
|
|
|
|
$this->workspaceTools->addAsyncOptionToSchedulerCommands(true);
|
|
|
|
|
$string = ob_get_clean();
|
|
|
|
|
$this->assertRegExp("/Adding \+async option/", $string);
|
|
|
|
|
}
|
|
|
|
|
}
|