ILIAS  release_7 Revision v7.30-3-g800a261c036
WorkflowStepTest.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2018 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
5require_once(__DIR__ . "/../../../../../libs/composer/vendor/autoload.php");
6require_once(__DIR__ . "/../../../Base.php");
7
8use \ILIAS\UI\Component\Listing\Workflow;
9
11{
12 protected function buildFactory()
13 {
15 }
16 public function setUp() : void
17 {
18 $this->f = $this->buildFactory();
19 }
20
22 {
23 $step = $this->f->step('', '');
24 $this->assertInstanceOf(Workflow\Step::class, $step);
25 }
26
27 public function test_constructor_params()
28 {
29 $label = 'label';
30 $description = 'description';
31 $step = $this->f->step($label, $description);
32 $this->assertEquals($label, $step->getLabel());
33 $this->assertEquals($description, $step->getDescription());
34 $this->assertEquals(Workflow\Step::NOT_STARTED, $step->getStatus());
35 }
36
37 public function test_withStatus()
38 {
39 $status = Workflow\Step::SUCCESSFULLY;
40 $step = $this->f->step('', '')->withStatus($status);
41 $this->assertEquals($status, $step->getStatus());
42 }
43
45 {
46 $status = 100;
47 $raised = false;
48 try {
49 $step = $this->f->step('', '')->withStatus($status);
50 } catch (\InvalidArgumentException $e) {
51 $raised = true;
52 }
53 $this->assertTrue($raised);
54 }
55}
An exception for terminatinating execution or to throw for unit testing.
Provides common functionality for UI tests.
Definition: Base.php:263