@@ -42,6 +42,7 @@ public function testCorrectlyIdentifiesR2D2AsTheHeroOfTheStarWarsSaga()
4242 ];
4343 $ this ->assertValidQuery ($ query , $ expected );
4444 }
45+
4546 public function testAllowsUsToQueryForTheIDAndFriendsOfR2D2 ()
4647 {
4748 $ query = '
@@ -74,6 +75,7 @@ public function testAllowsUsToQueryForTheIDAndFriendsOfR2D2()
7475 ];
7576 $ this ->assertValidQuery ($ query , $ expected );
7677 }
78+
7779 // Nested Queries
7880 public function testAllowsUsToQueryForTheFriendsOfFriendsOfR2D2 ()
7981 {
@@ -130,6 +132,7 @@ public function testAllowsUsToQueryForTheFriendsOfFriendsOfR2D2()
130132 ];
131133 $ this ->assertValidQuery ($ query , $ expected );
132134 }
135+
133136 // Using IDs and query parameters to refetch objects
134137 public function testAllowsUsToQueryForLukeSkywalkerDirectlyUsingHisID ()
135138 {
@@ -167,6 +170,7 @@ public function testGenericQueryToGetLukeSkywalkerById()
167170 ];
168171 $ this ->assertValidQuery ($ query , $ expected , $ params );
169172 }
173+
170174 public function testGenericQueryToGetHanSoloById ()
171175 {
172176 // Allows us to create a generic query, then use it to fetch Han Solo using his ID
@@ -187,6 +191,7 @@ public function testGenericQueryToGetHanSoloById()
187191 ];
188192 $ this ->assertValidQuery ($ query , $ expected , $ params );
189193 }
194+
190195 public function testGenericQueryWithInvalidId ()
191196 {
192197 // Allows us to create a generic query, then pass an invalid ID to get null back
@@ -205,6 +210,7 @@ public function testGenericQueryWithInvalidId()
205210 ];
206211 $ this ->assertValidQuery ($ query , $ expected , $ params );
207212 }
213+
208214 // Using aliases to change the key in the response
209215 public function testLukeKeyAlias ()
210216 {
@@ -223,6 +229,7 @@ public function testLukeKeyAlias()
223229 ];
224230 $ this ->assertValidQuery ($ query , $ expected );
225231 }
232+
226233 public function testTwoRootKeysAsAnAlias ()
227234 {
228235 // Allows us to query for both Luke and Leia, using two root fields and an alias
@@ -246,6 +253,7 @@ public function testTwoRootKeysAsAnAlias()
246253 ];
247254 $ this ->assertValidQuery ($ query , $ expected );
248255 }
256+
249257 // Uses fragments to express more complex queries
250258 public function testQueryUsingDuplicatedContent ()
251259 {
@@ -274,6 +282,7 @@ public function testQueryUsingDuplicatedContent()
274282 ];
275283 $ this ->assertValidQuery ($ query , $ expected );
276284 }
285+
277286 public function testUsingFragment ()
278287 {
279288 // Allows us to use a fragment to avoid duplicating content
@@ -303,6 +312,7 @@ public function testUsingFragment()
303312 ];
304313 $ this ->assertValidQuery ($ query , $ expected );
305314 }
315+
306316 // Using __typename to find the type of an object
307317 public function testVerifyThatR2D2IsADroid ()
308318 {
@@ -322,6 +332,7 @@ public function testVerifyThatR2D2IsADroid()
322332 ];
323333 $ this ->assertValidQuery ($ query , $ expected );
324334 }
335+
325336 public function testVerifyThatLukeIsHuman ()
326337 {
327338 $ query = '
@@ -340,4 +351,19 @@ public function testVerifyThatLukeIsHuman()
340351 ];
341352 $ this ->assertValidQuery ($ query , $ expected );
342353 }
354+
355+ public function testDateTime ()
356+ {
357+ $ query = '{ dateTime } ' ;
358+ $ expected = [
359+ 'dateTime ' => '2016-11-28 12:00:00 ' ,
360+ ];
361+ $ this ->assertValidQuery ($ query , $ expected );
362+
363+ $ query = '{ dateTime(dateTime: "2016-01-18 23:00:00") } ' ;
364+ $ expected = [
365+ 'dateTime ' => '2016-01-18 23:00:00 ' ,
366+ ];
367+ $ this ->assertValidQuery ($ query , $ expected );
368+ }
343369}
0 commit comments