diff --git a/tests/Feature/AdminLoginFailTest.php b/tests/Feature/AdminLoginFailTest.php new file mode 100644 index 0000000..ef4add0 --- /dev/null +++ b/tests/Feature/AdminLoginFailTest.php @@ -0,0 +1,32 @@ +postJson('/api/login',[ + 'email'=>'admin@hydra.project', + 'password'=>'hydrax' + ]); + + $response + ->assertJson(fn (AssertableJson $json) => + $json->where('error', 1) + ->missing('token') + ->has('message') + ); + } +} diff --git a/tests/Feature/AdminLoginTest.php b/tests/Feature/AdminLoginTest.php new file mode 100644 index 0000000..52f0c40 --- /dev/null +++ b/tests/Feature/AdminLoginTest.php @@ -0,0 +1,32 @@ +postJson('/api/login',[ + 'email'=>'admin@hydra.project', + 'password'=>'hydra' + ]); + + $response + ->assertJson(fn (AssertableJson $json) => + $json->where('error', 0) + ->has('token') + ->etc() + ); + } +} diff --git a/tests/Feature/HelloHydraTest.php b/tests/Feature/HelloHydraTest.php new file mode 100644 index 0000000..63ae7a9 --- /dev/null +++ b/tests/Feature/HelloHydraTest.php @@ -0,0 +1,37 @@ +get('/api/hydra'); + + $response + ->assertStatus(200) + ->assertJson([ + 'message' => true, + ]); + } + + public function test_hydra_version() + { + $response = $this->get('/api/hydra/version'); + + $response + ->assertStatus(200) + ->assertJson([ + 'message' => true, + ]); + } +}