mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-20 11:33:59 +00:00
Include a batch of naughty strings to see what happens to Firefly.
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user