ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
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
4
require_once(
"libs/composer/vendor/autoload.php"
);
5
6
use
ILIAS\Data
;
7
13
class
DataFactoryTest
extends
PHPUnit_Framework_TestCase
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
41
public
function
testPassword
()
42
{
43
$pwd = $this->f->password(
"secret"
);
44
$this->assertInstanceOf(Data\Password::class, $pwd);
45
}
46
}
DataFactoryTest\testOk
testOk()
Definition:
DataFactoryTest.php:25
$result
$result
Definition:
CleanUpTest.php:463
PHPUnit_Framework_TestCase
DataFactoryTest
Testing the faytory of result objects.
Definition:
DataFactoryTest.php:13
DataFactoryTest\testPassword
testPassword()
Definition:
DataFactoryTest.php:41
DataFactoryTest\tearDown
tearDown()
Definition:
DataFactoryTest.php:20
DataFactoryTest\testError
testError()
Definition:
DataFactoryTest.php:33
php
DataFactoryTest\setUp
setUp()
Definition:
DataFactoryTest.php:15
ILIAS\Data
Definition:
ClientId.php:4
tests
Data
DataFactoryTest.php
Generated on Thu Jan 16 2025 19:02:38 for ILIAS by
1.8.13 (using
Doxyfile
)