FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
phpunit/assertions.php at expectedException · axisK/phpunit · GitHub
axisK
phpunit
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
phpunit
/
assertions.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
65 lines (56 loc) · 2.02 KB
Breadcrumbs
phpunit
/
assertions.php
Copy path
File metadata and controls
executable file
·
65 lines (56 loc) · 2.02 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!/usr/bin/env php
<?php
require_once
'
PHPUnit/Autoload.php
'
;
$
buffer
=
''
;
$
class
=
new
ReflectionClass
(
'
PHPUnit_Framework_Assert
'
);
$
methods
=
array
();
foreach
(
$
class
->
getMethods
()
as
$
method
) {
$
docblock
=
$
method
->
getDocComment
();
$
name
=
$
method
->
getName
();
if
(
strpos
(
$
name
,
'
assert
'
) ===
0
||
strpos
(
$
docblock
,
'
@return PHPUnit_Framework_Constraint
'
) !==
FALSE
) {
$
methods
[
$
name
] =
array
(
'
class
'
=>
'
PHPUnit_Framework_Assert
'
,
'
docblock
'
=>
$
docblock
,
'
sigDecl
'
=>
str_replace
(
array
(
'
= false
'
,
'
= true
'
),
array
(
'
= FALSE
'
,
'
= TRUE
'
),
PHPUnit_Util_Class::
getMethodParameters
(
$
method
)
),
'
sigCall
'
=> PHPUnit_Util_Class::
getMethodParameters
(
$
method
,
TRUE
)
);
}
}
$
class
=
new
ReflectionClass
(
'
PHPUnit_Framework_TestCase
'
);
foreach
(
$
class
->
getMethods
()
as
$
method
) {
$
docblock
=
$
method
->
getDocComment
();
$
name
=
$
method
->
getName
();
if
(
strpos
(
$
docblock
,
'
@return PHPUnit_Framework_MockObject_Matcher
'
) !==
FALSE
||
strpos
(
$
docblock
,
'
@return PHPUnit_Framework_MockObject_Stub
'
) !==
FALSE
) {
$
methods
[
$
name
] =
array
(
'
class
'
=>
'
PHPUnit_Framework_TestCase
'
,
'
docblock
'
=>
$
docblock
,
'
sigDecl
'
=>
str_replace
(
array
(
'
= false
'
,
'
= true
'
),
array
(
'
= FALSE
'
,
'
= TRUE
'
),
PHPUnit_Util_Class::
getMethodParameters
(
$
method
)
),
'
sigCall
'
=> PHPUnit_Util_Class::
getMethodParameters
(
$
method
,
TRUE
)
);
}
}
ksort
(
$
methods
);
foreach
(
$
methods
as
$
name
=>
$
data
) {
$
buffer
.=
sprintf
(
"\n\n
%s
\n
function %s(%s)
\n
{
\n
return %s::%s(%s);
\n
}
"
,
str_replace
(
'
'
,
''
,
$
data
[
'
docblock
'
]),
$
name
,
$
data
[
'
sigDecl
'
],
$
data
[
'
class
'
],
$
name
,
$
data
[
'
sigCall
'
]
);
}
$
template
=
new
Text_Template
(
'
PHPUnit/Framework/Assert/Functions.php.in
'
);
$
template
->
setVar
(
array
(
'
functions
'
=>
$
buffer
));
$
template
->
renderTo
(
'
PHPUnit/Framework/Assert/Functions.php
'
);
Back
|
FazBrowse Home
|
New Git URL