mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 08:30:06 +00:00
Expanded test coverage.
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* ForgotPasswordControllerTest.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
* This software may be modified and distributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
*
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Feature\Controllers\Auth;
|
||||
|
||||
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ForgotPasswordControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\ForgotPasswordController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\ForgotPasswordController::sendResetLinkEmail
|
||||
*/
|
||||
public function testSendResetLinkEmail()
|
||||
{
|
||||
$repository = $this->mock(UserRepositoryInterface::class);
|
||||
$repository->shouldReceive('hasRole')->andReturn(false);
|
||||
$data = [
|
||||
'email' => 'thegrumpydictator@gmail.com',
|
||||
];
|
||||
|
||||
$response = $this->post(route('password.email'), $data);
|
||||
$response->assertStatus(302);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\ForgotPasswordController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\ForgotPasswordController::sendResetLinkEmail
|
||||
*/
|
||||
public function testSendResetLinkEmailDemo()
|
||||
{
|
||||
$repository = $this->mock(UserRepositoryInterface::class);
|
||||
$repository->shouldReceive('hasRole')->andReturn(true);
|
||||
$data = [
|
||||
'email' => 'thegrumpydictator@gmail.com',
|
||||
];
|
||||
|
||||
$response = $this->post(route('password.email'), $data);
|
||||
$response->assertStatus(302);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user