/
Test.php
47 lines (41 loc) · 1.02 KB
/
Test.php
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
39
40
41
42
43
44
45
46
47
<?php
/**
* Created by PhpStorm.
* User: Adminiator
* Date: 2016-02-01
* Time: 21:16
*/
class Test extends PHPUnit_Framework_TestCase
{
/**
* @expectedException \Enforce\EnforceException
*/
function testEnforceThrows() {
\Enforce\enforce(0, "Tryed to enforce value 0");
}
function testEnforcePasses() {
\Enforce\enforce(1, "Tryed to enforce value 1");
}
/**
* @expectedException \Enforce\EnforceException
*/
function testEnforceExistsThrows() {
$arr = [5 => 0];
\Enforce\enforceExists(4, $arr, "Arr");
}
function testEnforceExistsPasses() {
$arr = [5 => 0];
\Enforce\enforceExists(5, $arr, "Arr");
}
/**
* @expectedException \Enforce\EnforceException
*/
function testEnforceNotExistsThrows() {
$arr = [5 => 0];
\Enforce\enforceNotExists(5, $arr, "Arr");
}
function testEnforceNotExistsPasses() {
$arr = [5 => 0];
\Enforce\enforceNotExists(4, $arr, "Arr");
}
}