fixes phpunit crashes

This commit is contained in:
Roly Rudy Gutierrez Pinto
2020-10-13 13:17:21 -04:00
committed by Julio Cesar Laura Avendaño
parent 56b2a4f6dd
commit 7de170eea1
2 changed files with 12 additions and 8 deletions

View File

@@ -33,12 +33,10 @@ class WorkflowToolsTest extends TestCase
*/
public function it_should_test_addAsyncOptionToSchedulerCommands_method()
{
//to do: a valid workspace is required.
if (!defined('HASH_INSTALLATION') || !defined('SYSTEM_HASH')) {
$message = "A workspace installation is required where the values HASH_INSTALLATION,"
. "SYSTEM_HASH, db.php exist and are correct.";
$this->markTestIncomplete($message);
}
//method "WorkspaceTools::initPropel(true)" crashes all connections
$message = "WorkspaceTools::initPropel(true) crashes all connections";
$this->markTestIncomplete($message);
ob_start();
$this->workspaceTools->addAsyncOptionToSchedulerCommands(false);
$string = ob_get_clean();

View File

@@ -5,6 +5,9 @@ namespace Tests\unit\workflow\engine\src\ProcessMaker\TaskScheduler;
use App\Jobs\TaskScheduler;
use Faker\Factory;
use Illuminate\Support\Facades\Queue;
use ProcessMaker\Model\Application;
use ProcessMaker\Model\AppThread;
use ProcessMaker\Model\Delegation;
use ProcessMaker\TaskScheduler\Task;
use Tests\TestCase;
@@ -24,6 +27,9 @@ class TaskTest extends TestCase
{
parent::setUp();
$this->faker = Factory::create();
Delegation::truncate();
AppThread::truncate();
Application::truncate();
}
/**
@@ -532,7 +538,7 @@ class TaskTest extends TestCase
//Creates a new task
$task = new Task($asynchronous, '');
//Sets the currect date
$date = date('Y-m-d H:i:s');
$date = date('Y-m-d H:i:s');
//assert synchronous for cron file
if ($asynchronous === false) {
ob_start();
@@ -541,7 +547,7 @@ class TaskTest extends TestCase
//Gets the result
$printing = ob_get_clean();
//Asserts the result is printing that there is no exisiting records to continue a case in the determined date
$this->assertRegExp('/No existing records to continue a case, on date "'.$date . '/', $printing);
$this->assertRegExp('/No existing records to continue a case, on date "' . $date . '/', $printing);
}
//assert asynchronous for job process
if ($asynchronous === true) {