ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
5 require_once(__DIR__ . "/../../../../../libs/composer/vendor/autoload.php");
6 require_once(__DIR__ . "/../../../Base.php");
7 
8 use \ILIAS\UI\Component\Listing\Workflow;
9 
11 {
12  protected function buildFactory()
13  {
15  }
16  public function setUp()
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 
44  public function test_withStatus_wrong_args()
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 }
Provides common functionality for UI tests.
Definition: Base.php:191
foreach( $_REQUEST as $var) foreach(array('_POST'=> 'HTTP_POST_VARS', '_GET'=> 'HTTP_GET_VARS', '_COOKIE'=> 'HTTP_COOKIE_VARS', '_SERVER'=> 'HTTP_SERVER_VARS', '_ENV'=> 'HTTP_ENV_VARS', '_FILES'=> 'HTTP_POST_FILES') as $array=> $other) $step
Definition: cssgen.php:155