ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
DataFactoryTest.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2017 Stefan Hecken <stefan.hecken@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
4require_once("libs/composer/vendor/autoload.php");
5
6use ILIAS\Data;
7
14{
15 protected function setUp()
16 {
17 $this->f = new Data\Factory();
18 }
19
20 protected function tearDown()
21 {
22 $this->f = null;
23 }
24
25 public function testOk()
26 {
27 $result = $this->f->ok(3.154);
28 $this->assertInstanceOf(Data\Result::class, $result);
29 $this->assertTrue($result->isOk());
30 $this->assertFalse($result->isError());
31 }
32
33 public function testError()
34 {
35 $result = $this->f->error("Something went wrong");
36 $this->assertInstanceOf(Data\Result::class, $result);
37 $this->assertTrue($result->isError());
38 $this->assertFalse($result->isOk());
39 }
40}
$result
An exception for terminatinating execution or to throw for unit testing.
Testing the faytory of result objects.
Builds data types.
Definition: Factory.php:15