mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-20 10:11:21 +00:00
Should cover models.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
|
||||
use FireflyIII\Models\Category;
|
||||
use League\FactoryMuffin\Facade as FactoryMuffin;
|
||||
|
||||
|
||||
/**
|
||||
* Class CategoryModelTest
|
||||
*/
|
||||
@@ -40,7 +44,33 @@ class CategoryModelTest extends TestCase
|
||||
*/
|
||||
public function testFirstOrCreateEncrypted()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
$category = FactoryMuffin::create('FireflyIII\Models\Category');
|
||||
|
||||
$search = [
|
||||
'name' => $category->name,
|
||||
'user_id' => $category->user_id
|
||||
];
|
||||
|
||||
$result = Category::firstOrCreateEncrypted($search);
|
||||
|
||||
$this->assertEquals($result->id, $category->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Models\Category::firstOrCreateEncrypted
|
||||
*/
|
||||
public function testFirstOrCreateEncryptedNew()
|
||||
{
|
||||
$category = FactoryMuffin::create('FireflyIII\Models\Category');
|
||||
|
||||
$search = [
|
||||
'name' => 'Some category name',
|
||||
'user_id' => $category->user_id
|
||||
];
|
||||
|
||||
$result = Category::firstOrCreateEncrypted($search);
|
||||
|
||||
$this->assertNotEquals($result->id, $category->id);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user