FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
hack-codegen/test/CodegenPropertyTest.php at master · Chipcius/hack-codegen · GitHub
Chipcius
/
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
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
hack-codegen
/
test
/
CodegenPropertyTest.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
88 lines (72 loc) · 1.98 KB
Breadcrumbs
hack-codegen
/
test
/
CodegenPropertyTest.php
Copy path
File metadata and controls
88 lines (72 loc) · 1.98 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<
?
hh
//
strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
namespace
Facebook\HackCodegen
;
final
class
CodegenPropertyTest
extends
CodegenBaseTest
{
public
function
testSimple
():
void
{
$code
=
$this
->
getCodegenFactory()
->
codegenProperty(
'
foo
'
)
->
render();
$this
->
assertUnchanged(
$code
);
}
public
function
testPublicStatic
():
void
{
$code
=
$this
->
getCodegenFactory()
->
codegenProperty(
'
foo
'
)
->
setPublic()
->
setIsStatic()
->
render();
$this
->
assertUnchanged(
$code
);
}
public
function
testTyped
():
void
{
$code
=
$this
->
getCodegenFactory()
->
codegenProperty(
'
name
'
)
->
setProtected()
->
setType(
'
string
'
)
->
render();
$this
->
assertUnchanged(
$code
);
}
public
function
testTypedWithFalsyValue
():
void
{
$code
=
$this
->
getCodegenFactory()
->
codegenProperty(
'
count
'
)
->
setType(
'
?int
'
)
->
setValue(
0
,
HackBuilderValues
::
export())
->
render();
$this
->
assertUnchanged(
$code
);
}
public
function
testArrayValues
():
void
{
$code
=
$this
->
getCodegenFactory()
->
codegenProperty(
'
languages
'
)
->
setIsStatic()
->
setValue(
array
(
'
en
'
=>
'
English
'
,
'
es
'
=>
'
Spanish
'
,
'
fr
'
=>
'
French
'
),
HackBuilderValues
::
export(),
)
->
render();
$this
->
assertUnchanged(
$code
);
}
public
function
testVector
():
void
{
$code
=
$this
->
getCodegenFactory()
->
codegenProperty(
'
parameters
'
)
->
setType(
'
Vector<string>
'
)
->
setValue(
'
Vector {}
'
,
HackBuilderValues
::
literal())
->
render();
$this
->
assertUnchanged(
$code
);
}
public
function
testDocBlock
():
void
{
$code
=
$this
->
getCodegenFactory()
->
codegenProperty(
'
thingWithComment
'
)
->
setInlineComment(
'
a comment
'
)
->
render();
$this
->
assertUnchanged(
$code
);
}
}
Back
|
FazBrowse Home
|
New Git URL