Also covered help.

This commit is contained in:
James Cole 2014-12-21 11:15:37 +01:00
parent 441f011fba
commit e62e0345df
3 changed files with 81 additions and 6 deletions

View File

@ -15,17 +15,13 @@ class Cleanup extends Command
*
* @var string
*/
// @codingStandardsIgnoreStart
protected $description = 'Clean caches, regenerate some stuff.';
// @codingStandardsIgnoreEnd
/**
* The console command name.
*
* @var string
*/
// @codingStandardsIgnoreStart
protected $name = 'firefly:cleanup';
// @codingStandardsIgnoreEnd
/**
*

View File

@ -3,6 +3,8 @@
/**
* Class PreferencesController
*
* @SuppressWarnings("CyclomaticComplexity") // It's all 5. So ok.
*
*/
class PreferencesController extends BaseController
{
@ -30,9 +32,10 @@ class PreferencesController extends BaseController
$accounts = $acct->getAssetAccounts();
$viewRange = $preferences->get('viewRange', '1M');
$viewRangeValue = $viewRange->data;
$frontpage = $preferences->get('frontpageAccounts', []);
$frontPage = $preferences->get('frontpageAccounts', []);
return View::make('preferences.index')->with('accounts', $accounts)->with('frontpageAccounts', $frontpage)->with('viewRange', $viewRangeValue);
return View::make('preferences.index')->with('accounts', $accounts)->with('frontpageAccounts', $frontPage)->with('viewRange', $viewRangeValue);
}
/**

View File

@ -0,0 +1,76 @@
<?php
/**
* Class HelpControllerCest
*
* @SuppressWarnings("CamelCase")
* @SuppressWarnings("short")
*/
class HelpControllerCest
{
/**
* @param FunctionalTester $I
*/
public function _after(FunctionalTester $I)
{
}
/**
* @param FunctionalTester $I
*/
public function _before(FunctionalTester $I)
{
$I->amLoggedAs(['email' => 'thegrumpydictator@gmail.com', 'password' => 'james']);
}
/**
* @param FunctionalTester $I
*/
public function show(FunctionalTester $I)
{
$I->wantTo('show help for the index page');
$I->amOnPage('/help/index');
$I->canSeeResponseCodeIs(200);
$I->see('text');
}
/**
* @param FunctionalTester $I
*/
public function showFromCache(FunctionalTester $I)
{
$I->wantTo('show help for the index page from the cache.');
$I->amOnPage('/help/index');
$I->amOnPage('/help/index');
$I->canSeeResponseCodeIs(200);
$I->see('text');
}
/**
* @param FunctionalTester $I
*/
public function showHelpInvalidRoute(FunctionalTester $I)
{
$I->wantTo('show help for a non-existing route.');
$I->amOnPage('/help/indexXXXX');
$I->canSeeResponseCodeIs(200);
$I->see('There is no help for this route');
}
/**
* @param FunctionalTester $I
*/
public function showHelpNoHelpFile(FunctionalTester $I)
{
$I->wantTo('show help for route that has no help file.');
$I->amOnPage('/help/help.show');
$I->canSeeResponseCodeIs(200);
$I->see('text');
}
}