forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScreenTest.php
More file actions
38 lines (30 loc) · 1.15 KB
/
ScreenTest.php
File metadata and controls
38 lines (30 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Tests\Resources;
use Tests\TestCase;
use ProcessMaker\Jobs\ImportProcess;
use ProcessMaker\Facades\WorkflowManager;
use Tests\Feature\Shared\RequestHelper;
class ScreenTest extends TestCase {
use RequestHelper;
public function testScreens()
{
$this->be($this->user);
$content = file_get_contents(
__DIR__ . '/../Fixtures/nested_screen_process.json'
);
$import = ImportProcess::dispatchNow($content);
$processRequest = WorkflowManager::triggerStartEvent(
$import->process,
$import->process->getDefinitions()->getEvent('node_1'),
[]
);
$task = $processRequest->tokens()->where('status', 'ACTIVE')->firstOrFail();
$screen = $task->getScreen();
$url = route('api.screens.show', [$screen]);
$result = $this->apiCall('GET', $url);
$json = $result->json();
$this->assertCount(5, $json['config'][0]['items']);
$this->assertEquals('FormHtmlViewer', $json['config'][0]['items'][2]['component']);
$this->assertEquals('FormHtmlViewer', $json['config'][0]['items'][3]['component']);
}
}