Various small fixes.

This commit is contained in:
James Cole
2016-12-28 11:34:00 +01:00
parent 49758c4e72
commit e64b778d13
21 changed files with 102 additions and 72 deletions

View File

@@ -60,15 +60,16 @@ class AccountControllerTest extends TestCase
*/
public function testDestroy()
{
$this->session(['accounts.delete.url' => 'http://localhost/accounts/show/1']);
$repository = $this->mock(AccountRepositoryInterface::class);
$repository->shouldReceive('find')->withArgs([0])->once()->andReturn(new Account);
$repository->shouldReceive('destroy')->andReturn(true);
$this->session(['accounts.delete.url' => 'http://localhost']);
$this->be($this->user());
$this->call('post', route('accounts.destroy', [1]));
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
}
/**
@@ -85,6 +86,7 @@ class AccountControllerTest extends TestCase
/**
* @covers FireflyIII\Http\Controllers\AccountController::index
* @covers FireflyIII\Http\Controllers\AccountController::isInArray
* @dataProvider dateRangeProvider
*
* @param string $range
@@ -101,6 +103,7 @@ class AccountControllerTest extends TestCase
/**
* @covers FireflyIII\Http\Controllers\AccountController::show
* @covers FireflyIII\Http\Controllers\AccountController::periodEntries
* @dataProvider dateRangeProvider
*
* @param string $range
@@ -129,7 +132,7 @@ class AccountControllerTest extends TestCase
}
/**
* @covers FireflyIII\Http\Controllers\AccountController::showWithDate
* @covers FireflyIII\Http\Controllers\AccountController::showAll
* @dataProvider dateRangeProvider
*
* @param string $range
@@ -145,7 +148,7 @@ class AccountControllerTest extends TestCase
}
/**
* @covers FireflyIII\Http\Controllers\AccountController::showWithDate
* @covers FireflyIII\Http\Controllers\AccountController::showByDate
* @dataProvider dateRangeProvider
*
* @param string $range

View File

@@ -58,7 +58,7 @@ class ConfigurationControllerTest extends TestCase
}
/**
* @covers \FireflyIII\Http\Controllers\Admin\ConfigurationController::store
* @covers \FireflyIII\Http\Controllers\Admin\ConfigurationController::postIndex
*/
public function testPostIndex()
{

View File

@@ -45,6 +45,7 @@ class AttachmentControllerTest extends TestCase
public function testDestroy()
{
$this->session(['attachments.delete.url' => 'http://localhost']);
$repository = $this->mock(AttachmentRepositoryInterface::class);
$repository->shouldReceive('destroy')->andReturn(true);
$this->be($this->user());