mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-23 14:26:58 +00:00
92 lines
2.6 KiB
PHP
92 lines
2.6 KiB
PHP
<?php
|
|
/**
|
|
* ConfirmationControllerTest.php
|
|
* Copyright (C) 2016 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.
|
|
*/
|
|
|
|
namespace Auth;
|
|
|
|
use FireflyIII\Models\Configuration;
|
|
use FireflyIII\Models\Preference;
|
|
use FireflyIII\Support\Facades\FireflyConfig;
|
|
use FireflyIII\Support\Facades\Preferences;
|
|
use TestCase;
|
|
|
|
/**
|
|
* Generated by PHPUnit_SkeletonGenerator on 2016-12-07 at 18:50:31.
|
|
*/
|
|
class ConfirmationControllerTest extends TestCase
|
|
{
|
|
|
|
|
|
/**
|
|
* Sets up the fixture, for example, opens a network connection.
|
|
* This method is called before a test is executed.
|
|
*/
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Auth\ConfirmationController::confirmationError
|
|
* Implement testConfirmationError().
|
|
*/
|
|
public function testConfirmationError()
|
|
{
|
|
// need a user that is not activated. And site must require activated users.
|
|
$user = $this->user();
|
|
$trueConfig = new Configuration;
|
|
$trueConfig->data = true;
|
|
|
|
$falsePreference = new Preference;
|
|
$falsePreference->data = true;
|
|
|
|
Preferences::shouldReceive('get')->withArgs(['user_confirmed',false])->andReturn($falsePreference);
|
|
|
|
FireflyConfig::shouldReceive('get')->withArgs(['must_confirm_account', false])->once()->andReturn($trueConfig);
|
|
|
|
$this->call('GET', route('confirmation_error'));
|
|
$this->assertResponseStatus(200);
|
|
$this->see('has been sent to the address you used during your registration');
|
|
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Auth\ConfirmationController::doConfirmation
|
|
* Implement testDoConfirmation().
|
|
*/
|
|
public function testDoConfirmation()
|
|
{
|
|
// Remove the following lines when you implement this test.
|
|
$this->markTestIncomplete(
|
|
'This test has not been implemented yet.'
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Auth\ConfirmationController::resendConfirmation
|
|
* Implement testResendConfirmation().
|
|
*/
|
|
public function testResendConfirmation()
|
|
{
|
|
// Remove the following lines when you implement this test.
|
|
$this->markTestIncomplete(
|
|
'This test has not been implemented yet.'
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Tears down the fixture, for example, closes a network connection.
|
|
* This method is called after a test is executed.
|
|
*/
|
|
protected function tearDown()
|
|
{
|
|
}
|
|
}
|