Expand tests.

This commit is contained in:
James Cole
2016-12-09 18:53:13 +01:00
parent 663be30117
commit 1b7546f3f9
5 changed files with 61 additions and 324 deletions

View File

@@ -1,99 +0,0 @@
<?php
/**
* PasswordControllerTest.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 TestCase;
/**
* Generated by PHPUnit_SkeletonGenerator on 2016-12-07 at 18:50:32.
*/
class PasswordControllerTest 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\PasswordController::broker
* Implement testBroker().
*/
public function testBroker()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \FireflyIII\Http\Controllers\Auth\PasswordController::redirectPath
* Implement testRedirectPath().
*/
public function testRedirectPath()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \FireflyIII\Http\Controllers\Auth\PasswordController::reset
* Implement testReset().
*/
public function testReset()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \FireflyIII\Http\Controllers\Auth\PasswordController::sendResetLinkEmail
* Implement testSendResetLinkEmail().
*/
public function testSendResetLinkEmail()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \FireflyIII\Http\Controllers\Auth\PasswordController::showResetForm
* Implement testShowResetForm().
*/
public function testShowResetForm()
{
// 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()
{
}
}

View File

@@ -1,75 +0,0 @@
<?php
/**
* RegisterControllerTest.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 TestCase;
/**
* Generated by PHPUnit_SkeletonGenerator on 2016-12-07 at 18:50:32.
*/
class RegisterControllerTest 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\RegisterController::redirectPath
* Implement testRedirectPath().
*/
public function testRedirectPath()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \FireflyIII\Http\Controllers\Auth\RegisterController::register
* Implement testRegister().
*/
public function testRegister()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \FireflyIII\Http\Controllers\Auth\RegisterController::showRegistrationForm
* Implement testShowRegistrationForm().
*/
public function testShowRegistrationForm()
{
// 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()
{
}
}

View File

@@ -1,87 +0,0 @@
<?php
/**
* ResetPasswordControllerTest.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 TestCase;
/**
* Generated by PHPUnit_SkeletonGenerator on 2016-12-07 at 18:50:32.
*/
class ResetPasswordControllerTest 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\ResetPasswordController::broker
* Implement testBroker().
*/
public function testBroker()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \FireflyIII\Http\Controllers\Auth\ResetPasswordController::redirectPath
* Implement testRedirectPath().
*/
public function testRedirectPath()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \FireflyIII\Http\Controllers\Auth\ResetPasswordController::reset
* Implement testReset().
*/
public function testReset()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \FireflyIII\Http\Controllers\Auth\ResetPasswordController::showResetForm
* Implement testShowResetForm().
*/
public function testShowResetForm()
{
// 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()
{
}
}

View File

@@ -11,6 +11,9 @@
namespace Auth; namespace Auth;
use FireflyIII\Models\Preference;
use FireflyIII\Support\Facades\Preferences;
use Google2FA;
use TestCase; use TestCase;
/** /**
@@ -35,10 +38,18 @@ class TwoFactorControllerTest extends TestCase
*/ */
public function testIndex() public function testIndex()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete(
'This test has not been implemented yet.' $falsePreference = new Preference;
); $falsePreference->data = true;
$secretPreference = new Preference;
$secretPreference->data = 'BlablaSeecret';
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($falsePreference);
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference);
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference);
//$has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret'));
$this->call('get', route('two-factor.index'));
$this->assertResponseStatus(200);
} }
/** /**
@@ -47,22 +58,18 @@ class TwoFactorControllerTest extends TestCase
*/ */
public function testLostTwoFactor() public function testLostTwoFactor()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/** $truePreference = new Preference;
* @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController::postIndex $truePreference->data = true;
* Implement testPostIndex(). $secretPreference = new Preference;
*/ $secretPreference->data = 'BlablaSeecret';
public function testPostIndex() Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($truePreference);
{ Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference);
// Remove the following lines when you implement this test. Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference);
$this->markTestIncomplete( //$has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret'));
'This test has not been implemented yet.' $this->call('get', route('two-factor.lost'));
); $this->assertResponseStatus(200);
} }
/** /**

View File

@@ -35,10 +35,9 @@ class AccountControllerTest extends TestCase
*/ */
public function testExpenseAccounts() public function testExpenseAccounts()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('chart.account.expense'));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
@@ -47,10 +46,9 @@ class AccountControllerTest extends TestCase
*/ */
public function testExpenseBudget() public function testExpenseBudget()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('chart.account.expense-budget', [1, '20120101', '20120131']));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
@@ -59,10 +57,9 @@ class AccountControllerTest extends TestCase
*/ */
public function testExpenseCategory() public function testExpenseCategory()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('chart.account.expense-category', [1, '20120101', '20120131']));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
@@ -71,10 +68,9 @@ class AccountControllerTest extends TestCase
*/ */
public function testFrontpage() public function testFrontpage()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('chart.account.frontpage'));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
@@ -83,10 +79,20 @@ class AccountControllerTest extends TestCase
*/ */
public function testIncomeCategory() public function testIncomeCategory()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('chart.account.income-category', [1, '20120101', '20120131']));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
); }
/**
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::period
* Implement testSpecificPeriod().
*/
public function testPeriod()
{
$this->be($this->user());
$this->call('get', route('chart.account.period', [1, '2012-01-01']));
$this->assertResponseStatus(200);
} }
/** /**
@@ -95,10 +101,9 @@ class AccountControllerTest extends TestCase
*/ */
public function testReport() public function testReport()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('chart.account.report', ['1', '20120101', '20120131']));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
@@ -107,10 +112,9 @@ class AccountControllerTest extends TestCase
*/ */
public function testRevenueAccounts() public function testRevenueAccounts()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('chart.account.revenue'));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
@@ -119,22 +123,9 @@ class AccountControllerTest extends TestCase
*/ */
public function testSingle() public function testSingle()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('chart.account.single', [1]));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
}
/**
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::specificPeriod
* Implement testSpecificPeriod().
*/
public function testSpecificPeriod()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
} }
/** /**