33namespace NotificationChannels \ExpoPushNotifications \Test ;
44
55use ExponentPhpSDK \Expo ;
6- use ExponentPhpSDK \ExpoRepository ;
7- use Illuminate \Contracts \Validation \Factory ;
86use Illuminate \Http \Request ;
9- use Illuminate \Support \Facades \Validator ;
107use ExponentPhpSDK \ExpoRegistrar ;
118use Illuminate \Events \Dispatcher ;
9+ use ExponentPhpSDK \ExpoRepository ;
1210use Illuminate \Support \Facades \Auth ;
11+ use Illuminate \Support \Facades \Validator ;
12+ use Illuminate \Contracts \Validation \Factory ;
1313use ExponentPhpSDK \Repositories \ExpoFileDriver ;
1414use NotificationChannels \ExpoPushNotifications \ExpoChannel ;
15- use NotificationChannels \ExpoPushNotifications \Http \ExpoController ;
1615use NotificationChannels \ExpoPushNotifications \Models \Interest ;
16+ use NotificationChannels \ExpoPushNotifications \Http \ExpoController ;
1717use NotificationChannels \ExpoPushNotifications \Repositories \ExpoDatabaseDriver ;
1818
1919class ExpoControllerTest extends TestCase
@@ -34,6 +34,7 @@ protected function setupExpo(ExpoRepository $expoRepository)
3434 {
3535 $ expoChannel = new ExpoChannel (new Expo (new ExpoRegistrar ($ expoRepository )), new Dispatcher );
3636 $ expoController = new ExpoController ($ expoChannel );
37+
3738 return [$ expoController , $ expoChannel ];
3839 }
3940
@@ -55,15 +56,15 @@ public function tearDown()
5556 }
5657
5758 /**
58- * Data provider to help test the expo controller with the different repositories
59+ * Data provider to help test the expo controller with the different repositories.
5960 *
6061 * @return array
6162 */
6263 public function availableRepositories ()
6364 {
6465 return [
6566 [new ExpoDatabaseDriver ],
66- [new ExpoFileDriver ]
67+ [new ExpoFileDriver ],
6768 ];
6869 }
6970
@@ -96,7 +97,7 @@ public function aDeviceCanSubscribeToTheSystem($expoRepository)
9697 if ($ expoRepository instanceof ExpoDatabaseDriver) {
9798 $ this ->assertDatabaseHas (config ('exponent-push-notifications.interests.database.table_name ' ), [
9899 'key ' => 'NotificationChannels.ExpoPushNotifications.Test.User. ' .(new User )->getKey (),
99- 'value ' => $ data ['expo_token ' ]
100+ 'value ' => $ data ['expo_token ' ],
100101 ]);
101102 }
102103 }
@@ -180,7 +181,7 @@ public function aDeviceCanUnsubscribeSingleTokenFromTheSystem($expoRepository)
180181 if ($ expoRepository instanceof ExpoDatabaseDriver) {
181182 $ this ->assertDatabaseMissing (config ('exponent-push-notifications.interests.database.table_name ' ), [
182183 'key ' => 'NotificationChannels.ExpoPushNotifications.Test.User. ' .(new User )->getKey (),
183- 'value ' => $ data ['expo_token ' ]
184+ 'value ' => $ data ['expo_token ' ],
184185 ]);
185186 }
186187 }
@@ -232,6 +233,7 @@ public function unsubscribeReturnsErrorResponseIfExceptionIsThrown()
232233
233234 $ this ->assertEquals ('failed ' , $ response ->status );
234235 }
236+
235237 /**
236238 * Mocks a request for the ExpoController.
237239 *
0 commit comments