mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-17 07:08:19 +00:00
Fix possible null pointer.
This commit is contained in:
@@ -33,6 +33,29 @@ use Tests\TestCase;
|
||||
*/
|
||||
class TransactionCurrencyFactoryTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \FireflyIII\Factory\TransactionCurrencyFactory
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
/** @var TransactionCurrencyFactory $factory */
|
||||
$factory = app(TransactionCurrencyFactory::class);
|
||||
$result = $factory->create(['name' => 'OK', 'code' => 'XXA', 'symbol' => 'Z', 'decimal_places' => 2]);
|
||||
$this->assertNotNull($result);
|
||||
$this->assertEquals('XXA', $result->code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Factory\TransactionCurrencyFactory
|
||||
*/
|
||||
public function testCreateEmpty()
|
||||
{
|
||||
/** @var TransactionCurrencyFactory $factory */
|
||||
$factory = app(TransactionCurrencyFactory::class);
|
||||
$result = $factory->create(['name' => null, 'code' => null, 'symbol' => null, 'decimal_places' => null]);
|
||||
$this->assertNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Factory\TransactionCurrencyFactory
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user