@@ -9,7 +9,7 @@ class TypeFunctionTest extends Test
9
9
/**
10
10
* @test
11
11
*/
12
- public function testIsNumber ()
12
+ public function itIdentifiesNumbers ()
13
13
{
14
14
$ this ->assertTrue (TypeFunctions \isNumber (0 ));
15
15
$ this ->assertTrue (TypeFunctions \isNumber (0.5 ));
@@ -23,7 +23,7 @@ public function testIsNumber()
23
23
/**
24
24
* @test
25
25
*/
26
- public function testIsBoolean ()
26
+ public function itIdentifiesBooleans ()
27
27
{
28
28
$ this ->assertTrue (TypeFunctions \isBoolean (true ));
29
29
$ this ->assertTrue (TypeFunctions \isBoolean (false ));
@@ -37,7 +37,7 @@ public function testIsBoolean()
37
37
/**
38
38
* @test
39
39
*/
40
- public function testIsNull ()
40
+ public function itIdentifiesNulls ()
41
41
{
42
42
$ this ->assertTrue (TypeFunctions \isNull (null ));
43
43
@@ -49,7 +49,7 @@ public function testIsNull()
49
49
/**
50
50
* @test
51
51
*/
52
- public function testIsObject ()
52
+ public function itIdentifiesObjects ()
53
53
{
54
54
$ this ->assertTrue (TypeFunctions \isObject ($ this ));
55
55
@@ -63,7 +63,7 @@ public function testIsObject()
63
63
/**
64
64
* @test
65
65
*/
66
- public function testIsFunction ()
66
+ public function itIdentifiesFunctions ()
67
67
{
68
68
$ function = function () {
69
69
echo "hello " ;
@@ -78,7 +78,7 @@ public function testIsFunction()
78
78
/**
79
79
* @test
80
80
*/
81
- public function testIsExpression ()
81
+ public function itIdentifiesExpressions ()
82
82
{
83
83
$ this ->assertTrue (TypeFunctions \isExpression ("[a-z] " ));
84
84
@@ -88,7 +88,7 @@ public function testIsExpression()
88
88
/**
89
89
* @test
90
90
*/
91
- public function testIsString ()
91
+ public function itIdentifiesStrings ()
92
92
{
93
93
$ this ->assertTrue (TypeFunctions \isString ("hello " ));
94
94
@@ -98,7 +98,7 @@ public function testIsString()
98
98
/**
99
99
* @test
100
100
*/
101
- public function testIsResource ()
101
+ public function itIdentifiesResources ()
102
102
{
103
103
$ file = fopen (__FILE__ , "r " );
104
104
@@ -112,7 +112,17 @@ public function testIsResource()
112
112
/**
113
113
* @test
114
114
*/
115
- public function testGetType ()
115
+ public function itIdentifiesArrays ()
116
+ {
117
+ $ this ->assertTrue (TypeFunctions \isArray (["foo " , "bar " ]));
118
+
119
+ $ this ->assertFalse (TypeFunctions \isArray ("foo " ));
120
+ }
121
+
122
+ /**
123
+ * @test
124
+ */
125
+ public function itIdentifiesTypes ()
116
126
{
117
127
$ file = fopen (__FILE__ , "r " );
118
128
@@ -121,14 +131,15 @@ public function testGetType()
121
131
};
122
132
123
133
$ types = [
124
- "number " => 1.5 ,
125
- "boolean " => true ,
126
- "null " => null ,
127
- "object " => $ this ,
128
- "function " => $ function ,
134
+ "number " => 1.5 ,
135
+ "boolean " => true ,
136
+ "null " => null ,
137
+ "object " => $ this ,
138
+ "function " => $ function ,
129
139
"expression " => "[a-z] " ,
130
- "string " => "hello " ,
131
- "resource " => $ file
140
+ "string " => "hello " ,
141
+ "resource " => $ file ,
142
+ "array " => ["foo " , "bar " ]
132
143
];
133
144
134
145
foreach ($ types as $ type => $ variable ) {
0 commit comments