mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-03 12:47:17 -06:00
Test code cleanup.
This commit is contained in:
parent
610f782054
commit
7b2fe8eb4a
@ -38,14 +38,8 @@ class AccountControllerTest extends TestCase
|
||||
public function testDestroy()
|
||||
{
|
||||
$this->be($this->user());
|
||||
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
|
||||
$this->session(['accounts.delete.url' => 'http://localhost']);
|
||||
|
||||
$response = $this->call('POST', '/accounts/destroy/6', $args);
|
||||
$response = $this->call('POST', '/accounts/destroy/6');
|
||||
$this->assertSessionHas('success');
|
||||
$this->assertEquals(302, $response->status());
|
||||
}
|
||||
@ -89,7 +83,6 @@ class AccountControllerTest extends TestCase
|
||||
$this->be($this->user());
|
||||
$this->session(['accounts.create.url' => 'http://localhost']);
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
'name' => 'Some kind of test account.',
|
||||
'what' => 'asset',
|
||||
'amount_currency_id_virtualBalance' => 1,
|
||||
@ -112,7 +105,6 @@ class AccountControllerTest extends TestCase
|
||||
'id' => 1,
|
||||
'name' => 'TestData new name',
|
||||
'active' => 1,
|
||||
'_token' => Session ::token(),
|
||||
];
|
||||
$this->be($this->user());
|
||||
|
||||
|
@ -29,14 +29,8 @@ class AttachmentControllerTest extends TestCase
|
||||
public function testDestroy()
|
||||
{
|
||||
$this->be($this->user());
|
||||
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
|
||||
$this->session(['attachments.delete.url' => 'http://localhost']);
|
||||
|
||||
$response = $this->call('POST', '/attachment/destroy/2', $args);
|
||||
$response = $this->call('POST', '/attachment/destroy/2');
|
||||
$this->assertEquals(302, $response->status());
|
||||
}
|
||||
|
||||
@ -81,7 +75,6 @@ class AttachmentControllerTest extends TestCase
|
||||
'title' => 'New title',
|
||||
'description' => 'New descr',
|
||||
'notes' => 'New notes',
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
$this->be($this->user());
|
||||
|
||||
|
@ -74,7 +74,6 @@ class AuthControllerTest extends TestCase
|
||||
'email' => 'thegrumpydictator@gmail.com',
|
||||
'password' => 'james',
|
||||
'remember' => 1,
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
$response = $this->call('POST', '/login', $args);
|
||||
$this->assertEquals(302, $response->status());
|
||||
@ -94,7 +93,6 @@ class AuthControllerTest extends TestCase
|
||||
'email' => 'thegrumpydictator+test@gmail.com',
|
||||
'password' => 'james123',
|
||||
'password_confirmation' => 'james123',
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
$response = $this->call('POST', '/register', $args);
|
||||
$this->assertEquals(302, $response->status());
|
||||
|
@ -19,7 +19,6 @@ class PasswordControllerTest extends TestCase
|
||||
{
|
||||
$args = [
|
||||
'email' => 'thegrumpydictator@gmail.com',
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
$response = $this->call('POST', '/password/email', $args);
|
||||
$this->assertEquals(302, $response->status());
|
||||
|
@ -42,10 +42,7 @@ class BillControllerTest extends TestCase
|
||||
{
|
||||
$this->session(['bills.delete.url' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
$response = $this->call('POST', '/bills/destroy/2', $args);
|
||||
$response = $this->call('POST', '/bills/destroy/2');
|
||||
$this->assertSessionHas('success');
|
||||
$this->assertEquals(302, $response->status());
|
||||
}
|
||||
@ -100,7 +97,6 @@ class BillControllerTest extends TestCase
|
||||
$args = [
|
||||
'name' => 'Some test',
|
||||
'match' => 'words',
|
||||
'_token' => Session::token(),
|
||||
'amount_min' => 10,
|
||||
'amount_max' => 100,
|
||||
'amount_currency_id_amount_min' => 1,
|
||||
@ -127,7 +123,6 @@ class BillControllerTest extends TestCase
|
||||
'id' => 1,
|
||||
'name' => 'Some test',
|
||||
'match' => 'words',
|
||||
'_token' => Session::token(),
|
||||
'amount_min' => 10,
|
||||
'amount_max' => 100,
|
||||
'amount_currency_id_amount_min' => 1,
|
||||
|
@ -20,7 +20,6 @@ class BudgetControllerTest extends TestCase
|
||||
{
|
||||
$args = [
|
||||
'amount' => 1200,
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
$this->be($this->user());
|
||||
|
||||
@ -55,13 +54,8 @@ class BudgetControllerTest extends TestCase
|
||||
{
|
||||
$this->be($this->user());
|
||||
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
|
||||
$this->session(['budgets.delete.url' => 'http://localhost']);
|
||||
|
||||
$response = $this->call('POST', '/budgets/destroy/2', $args);
|
||||
$response = $this->call('POST', '/budgets/destroy/2');
|
||||
$this->assertSessionHas('success');
|
||||
$this->assertEquals(302, $response->status());
|
||||
}
|
||||
@ -103,7 +97,6 @@ class BudgetControllerTest extends TestCase
|
||||
{
|
||||
$args = [
|
||||
'amount' => 1200,
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
$this->be($this->user());
|
||||
|
||||
@ -129,7 +122,6 @@ class BudgetControllerTest extends TestCase
|
||||
$this->be($this->user());
|
||||
$this->session(['budgets.create.url' => 'http://localhost']);
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
'name' => 'Some kind of test budget.',
|
||||
];
|
||||
|
||||
@ -146,7 +138,6 @@ class BudgetControllerTest extends TestCase
|
||||
$this->be($this->user());
|
||||
$this->session(['budgets.edit.url' => 'http://localhost']);
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
'name' => 'Some kind of test budget.',
|
||||
];
|
||||
|
||||
|
@ -41,13 +41,9 @@ class CategoryControllerTest extends TestCase
|
||||
{
|
||||
$this->be($this->user());
|
||||
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
|
||||
$this->session(['categories.delete.url' => 'http://localhost']);
|
||||
|
||||
$response = $this->call('POST', '/categories/destroy/2', $args);
|
||||
$response = $this->call('POST', '/categories/destroy/2');
|
||||
$this->assertSessionHas('success');
|
||||
$this->assertEquals(302, $response->status());
|
||||
}
|
||||
@ -84,6 +80,7 @@ class CategoryControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\CategoryController::show
|
||||
* @covers FireflyIII\Http\Controllers\Controller::getSumOfRange
|
||||
*/
|
||||
public function testShow()
|
||||
{
|
||||
@ -111,7 +108,6 @@ class CategoryControllerTest extends TestCase
|
||||
$this->be($this->user());
|
||||
$this->session(['categories.create.url' => 'http://localhost']);
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
'name' => 'Some kind of test cat.',
|
||||
];
|
||||
|
||||
@ -128,7 +124,6 @@ class CategoryControllerTest extends TestCase
|
||||
$this->be($this->user());
|
||||
$this->session(['categories.edit.url' => 'http://localhost']);
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
'name' => 'Some kind of test category.',
|
||||
];
|
||||
|
||||
|
@ -112,7 +112,6 @@ class CsvControllerTest extends TestCase
|
||||
6 => 'budget-name',
|
||||
],
|
||||
'map' => [],
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
|
||||
// create session data:
|
||||
@ -160,7 +159,6 @@ class CsvControllerTest extends TestCase
|
||||
$this->be($this->user());
|
||||
$this->session($this->getSessionData());
|
||||
$postData = [
|
||||
'_token' => Session::token(),
|
||||
'mapping'
|
||||
=> [0 => ['NL11XOLA6707795988' => '1',],
|
||||
1 => ['NL10TAPT8906262744' => '0', 'NL93UPSZ1261542703' => '0', 'NL86IHAL3264575116' => '0', 'NL63BKBO9993148806' => '0',
|
||||
@ -193,7 +191,6 @@ class CsvControllerTest extends TestCase
|
||||
|
||||
$file = new UploadedFile(storage_path('build/test-upload.csv'), 'test-file.csv', 'text/plain', 446);
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
'date_format' => 'Ymd',
|
||||
'csv_import_account' => 1,
|
||||
];
|
||||
|
@ -51,15 +51,9 @@ class CurrencyControllerTest extends TestCase
|
||||
*/
|
||||
public function testDestroy()
|
||||
{
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
|
||||
$this->session(['currency.delete.url' => 'http://localhost/currency']);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->call('POST', '/currency/destroy/3', $args);
|
||||
$response = $this->call('POST', '/currency/destroy/3');
|
||||
$this->assertSessionHas('success');
|
||||
$this->assertRedirectedToRoute('currency.index');
|
||||
$this->assertEquals(302, $response->status());
|
||||
@ -94,7 +88,6 @@ class CurrencyControllerTest extends TestCase
|
||||
$this->be($this->user());
|
||||
$this->session(['currency.create.url' => 'http://localhost/currency']);
|
||||
$args = [
|
||||
'_token' => Session::token(),
|
||||
'name' => 'New Euro.',
|
||||
'symbol' => 'Y',
|
||||
'code' => 'IUY',
|
||||
@ -118,7 +111,6 @@ class CurrencyControllerTest extends TestCase
|
||||
'name' => 'New Euro.',
|
||||
'symbol' => 'Y',
|
||||
'code' => 'IUY',
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
$this->be($this->user());
|
||||
|
||||
|
@ -20,7 +20,6 @@ class HomeControllerTest extends TestCase
|
||||
$args = [
|
||||
'start' => '2012-01-01',
|
||||
'end' => '2012-04-01',
|
||||
'_token' => Session::token(),
|
||||
];
|
||||
|
||||
// if date range is > 50, should have flash.
|
||||
@ -41,6 +40,7 @@ class HomeControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\HomeController::index
|
||||
* @covers FireflyIII\Http\Controllers\Controller::__construct
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
|
@ -16,25 +16,39 @@ class NewUserControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\NewUserController::index
|
||||
* @todo Implement testIndex().
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->emptyUser());
|
||||
$this->call('GET', '/');
|
||||
$this->assertResponseStatus(302);
|
||||
$this->assertRedirectedToRoute('new-user.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\NewUserController::index
|
||||
*/
|
||||
public function testIndexGo()
|
||||
{
|
||||
$this->be($this->emptyUser());
|
||||
$this->call('GET', '/new-user');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\NewUserController::submit
|
||||
* @todo Implement testSubmit().
|
||||
*/
|
||||
public function testSubmit()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->emptyUser());
|
||||
|
||||
$args = [
|
||||
'bank_name' => 'New bank',
|
||||
'bank_balance' => 100,
|
||||
];
|
||||
|
||||
$this->call('POST', '/new-user/submit', $args);
|
||||
$this->assertResponseStatus(302);
|
||||
$this->assertSessionHas('success');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user