FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
hack-codegen/test/CodegenMemberVarTestCase.php at master · Daniel15/hack-codegen · GitHub
Daniel15
/
hack-codegen
Public
forked from
hhvm/hack-codegen
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
hack-codegen
/
test
/
CodegenMemberVarTestCase.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
73 lines (57 loc) · 1.67 KB
Breadcrumbs
hack-codegen
/
test
/
CodegenMemberVarTestCase.php
Copy path
File metadata and controls
73 lines (57 loc) · 1.67 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
66
67
68
69
70
71
72
73
<
?
hh
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
namespace
Facebook\HackCodegen
;
final
class
CodegenMemberVarTestCase
extends
CodegenBaseTest
{
public
function
testSimple
() {
$code
=
codegen_member_var
(
'
foo
'
)
->
render();
self
::
assertUnchanged(
$code
);
}
public
function
testPublicStatic
() {
$code
=
codegen_member_var
(
'
foo
'
)
->
setPublic()
->
setIsStatic()
->
render();
self
::
assertUnchanged(
$code
);
}
public
function
testTyped
() {
$code
=
codegen_member_var
(
'
name
'
)
->
setProtected()
->
setType(
'
string
'
)
->
render();
self
::
assertUnchanged(
$code
);
}
public
function
testTypedWithFalsyValue
() {
$code
=
codegen_member_var
(
'
count
'
)
->
setType(
'
?int
'
)
->
setValue(
0
)
->
render();
self
::
assertUnchanged(
$code
);
}
public
function
testArrayValues
() {
$code
=
codegen_member_var
(
'
languages
'
)
->
setIsStatic()
->
setValue(
array
(
'
en
'
=>
'
English
'
,
'
es
'
=>
'
Spanish
'
,
'
fr
'
=>
'
French
'
))
->
render();
self
::
assertUnchanged(
$code
);
}
public
function
testVector
() {
$code
=
codegen_member_var
(
'
parameters
'
)
->
setType(
'
Vector<string>
'
)
->
setLiteralValue(
'
Vector {}
'
)
->
render();
self
::
assertUnchanged(
$code
);
}
public
function
testDocBlock
() {
$code
=
codegen_member_var
(
'
thingWithComment
'
)
->
setInlineComment(
'
a comment
'
)
->
render();
self
::
assertUnchanged(
$code
);
}
}
Back
|
FazBrowse Home
|
New Git URL