function.php
1.55 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
if (!function_exists('verify')) {
/**
* @param $description
* @param null $actual
* @return \Codeception\Verify
*/
function verify($description) {
include_once __DIR__.'/Verify.php';
$reflect = new ReflectionClass('\Codeception\Verify');
return $reflect->newInstanceArgs(func_get_args());
}
function verify_that($truth) {
verify($truth)->notEmpty();
}
function verify_not($fallacy) {
verify($fallacy)->isEmpty();
}
}
if (!function_exists('expect')) {
/**
* @param $description
* @param null $actual
* @return \Codeception\Verify
*/
function expect() {
return call_user_func_array('verify', func_get_args());
}
function expect_that($truth) {
expect($truth)->notEmpty();
}
function expect_not($fallacy) {
expect($fallacy)->isEmpty();
}
}
if (!function_exists('verify_file')) {
/**
* @param $description
* @param null $actual
* @return \Codeception\Verify
*/
function verify_file() {
include_once __DIR__.'/Verify.php';
$reflect = new ReflectionClass('\Codeception\Verify');
$verify = $reflect->newInstanceArgs(func_get_args());
$verify->setIsFileExpectation(true);
return $verify;
}
}
if (!function_exists('expect_file')) {
/**
* @param $description
* @param null $actual
* @return \Codeception\Verify
*/
function expect_file() {
return call_user_func_array('verify_file', func_get_args());
}
}