mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 14:48:11 +00:00
Some code cleanup.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Feature\Controllers;
|
||||
|
||||
@@ -27,6 +27,24 @@ use Tests\TestCase;
|
||||
class CurrencyControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\CurrencyController::create
|
||||
*/
|
||||
public function testCannotCreate()
|
||||
{
|
||||
// mock stuff
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$userRepos->shouldReceive('hasRole')->once()->andReturn(false);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('currencies.create'));
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('error');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\CurrencyController::delete
|
||||
*/
|
||||
@@ -70,24 +88,6 @@ class CurrencyControllerTest extends TestCase
|
||||
$response->assertSessionHas('error');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\CurrencyController::create
|
||||
*/
|
||||
public function testCannotCreate()
|
||||
{
|
||||
// mock stuff
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$userRepos->shouldReceive('hasRole')->once()->andReturn(false);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('currencies.create'));
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('error');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\CurrencyController::create
|
||||
*/
|
||||
@@ -236,7 +236,7 @@ class CurrencyControllerTest extends TestCase
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\CurrencyController::store
|
||||
*/
|
||||
public function testStoreNoRights()
|
||||
public function testStore()
|
||||
{
|
||||
// mock stuff
|
||||
$repository = $this->mock(CurrencyRepositoryInterface::class);
|
||||
@@ -263,7 +263,7 @@ class CurrencyControllerTest extends TestCase
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\CurrencyController::store
|
||||
*/
|
||||
public function testStore()
|
||||
public function testStoreNoRights()
|
||||
{
|
||||
// mock stuff
|
||||
$repository = $this->mock(CurrencyRepositoryInterface::class);
|
||||
|
||||
Reference in New Issue
Block a user