-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLaravelTest.php
46 lines (39 loc) · 1.1 KB
/
LaravelTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace Appoly\LaravelApiPasswordHelper\Tests;
use Appoly\LaravelApiPasswordHelper\ApiPasswordServiceProvider;
use Appoly\LaravelApiPasswordHelper\Facades\ApiPassword;
use Orchestra\Testbench\TestCase;
class LaravelTest extends TestCase
{
protected function getPackageProviders($app)
{
return [
ApiPasswordServiceProvider::class,
];
}
protected function getPackageAliases($app)
{
return [
'ApiPasswords' => ApiPassword::class,
];
}
/** @test */
public function forgot_password_route_can_be_accessed()
{
$this->get('/api/forgot-password?email="calum@example.com"')
->assertJson(['message' => 'No user found'])
->assertStatus(400);
}
/** @test */
public function reset_password_test()
{
$data = [
'key' => '123456',
'email' => 'johndoe@example.com',
'password' => 'secret',
];
$this->post('/api/forgot-password', $data)
->assertJson(['message' => 'No user found'])
->assertStatus(400);
}
}