@@ -9,7 +9,7 @@ class TypeFunctionTest extends Test
99 /**
1010 * @test
1111 */
12- public function testIsNumber ()
12+ public function itIdentifiesNumbers ()
1313 {
1414 $ this ->assertTrue (TypeFunctions \isNumber (0 ));
1515 $ this ->assertTrue (TypeFunctions \isNumber (0.5 ));
@@ -23,7 +23,7 @@ public function testIsNumber()
2323 /**
2424 * @test
2525 */
26- public function testIsBoolean ()
26+ public function itIdentifiesBooleans ()
2727 {
2828 $ this ->assertTrue (TypeFunctions \isBoolean (true ));
2929 $ this ->assertTrue (TypeFunctions \isBoolean (false ));
@@ -37,7 +37,7 @@ public function testIsBoolean()
3737 /**
3838 * @test
3939 */
40- public function testIsNull ()
40+ public function itIdentifiesNulls ()
4141 {
4242 $ this ->assertTrue (TypeFunctions \isNull (null ));
4343
@@ -49,7 +49,7 @@ public function testIsNull()
4949 /**
5050 * @test
5151 */
52- public function testIsObject ()
52+ public function itIdentifiesObjects ()
5353 {
5454 $ this ->assertTrue (TypeFunctions \isObject ($ this ));
5555
@@ -63,7 +63,7 @@ public function testIsObject()
6363 /**
6464 * @test
6565 */
66- public function testIsFunction ()
66+ public function itIdentifiesFunctions ()
6767 {
6868 $ function = function () {
6969 echo "hello " ;
@@ -78,7 +78,7 @@ public function testIsFunction()
7878 /**
7979 * @test
8080 */
81- public function testIsExpression ()
81+ public function itIdentifiesExpressions ()
8282 {
8383 $ this ->assertTrue (TypeFunctions \isExpression ("[a-z] " ));
8484
@@ -88,7 +88,7 @@ public function testIsExpression()
8888 /**
8989 * @test
9090 */
91- public function testIsString ()
91+ public function itIdentifiesStrings ()
9292 {
9393 $ this ->assertTrue (TypeFunctions \isString ("hello " ));
9494
@@ -98,7 +98,7 @@ public function testIsString()
9898 /**
9999 * @test
100100 */
101- public function testIsResource ()
101+ public function itIdentifiesResources ()
102102 {
103103 $ file = fopen (__FILE__ , "r " );
104104
@@ -112,7 +112,17 @@ public function testIsResource()
112112 /**
113113 * @test
114114 */
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 ()
116126 {
117127 $ file = fopen (__FILE__ , "r " );
118128
@@ -121,14 +131,15 @@ public function testGetType()
121131 };
122132
123133 $ 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 ,
129139 "expression " => "[a-z] " ,
130- "string " => "hello " ,
131- "resource " => $ file
140+ "string " => "hello " ,
141+ "resource " => $ file ,
142+ "array " => ["foo " , "bar " ]
132143 ];
133144
134145 foreach ($ types as $ type => $ variable ) {
0 commit comments