Include a batch of naughty strings to see what happens to Firefly.

This commit is contained in:
James Cole
2017-01-16 20:10:47 +01:00
parent 1e69a54972
commit 77f889aba6
3 changed files with 520 additions and 12 deletions

View File

@@ -85,7 +85,7 @@ class SingleControllerTest extends TestCase
}
/**
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::store
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::store
*/
public function testStore()
{
@@ -99,13 +99,36 @@ class SingleControllerTest extends TestCase
'source_account_id' => 1,
'destination_account_name' => 'Some destination',
'date' => '2016-01-01',
'description' => 'Some description',
'description' => 'Test descr',
];
$this->call('post', route('transactions.store', ['withdrawal']), $data);
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
}
/**
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::store
* @dataProvider naughtyStringProvider
*/
public function testStoreNaughty(string $description)
{
$this->session(['transactions.create.url' => 'http://localhost']);
$this->be($this->user());
$data = [
'what' => 'withdrawal',
'amount' => '10',
'amount_currency_id_amount' => 1,
'source_account_id' => 1,
'destination_account_name' => 'Some destination',
'date' => '2016-01-01',
'description' => $description,
];
$response = $this->call('post', route('transactions.store', ['withdrawal']), $data);
$this->assertNotEquals($response->getStatusCode(), 500);
}
/**
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::update
*/