Fix tests

This commit is contained in:
James Cole
2019-08-04 11:12:24 +02:00
parent 62b5cf04ad
commit 2147caf3ef
5 changed files with 33 additions and 10 deletions

View File

@@ -62,7 +62,7 @@ class TagFactoryTest extends TestCase
*/
public function testFindOrCreateNew(): void
{
$tag = sprintf('Some new tag #%d', $this->randomInt());
$tag = sprintf('§Some new tag #%d', $this->randomInt());
/** @var TagFactory $factory */
$factory = app(TagFactory::class);
$factory->setUser($this->user());

View File

@@ -58,8 +58,10 @@ class ConvertToTransferTest extends TestCase
public function testActDeposit(): void
{
$deposit = $this->getRandomDeposit();
/** @var Account $asset */
$asset = $this->getRandomAsset();
// make sure that $asset is not the destination account of $deposit:
$forbiddenId = (int)$deposit->transactions()->where('amount', '>', 0)->first()->account_id;
$asset = $this->getRandomAsset($forbiddenId);
// mock used stuff:
$accountRepos = $this->mock(AccountRepositoryInterface::class);

View File

@@ -64,7 +64,6 @@ class RecurrenceTransformerTest extends TestCase
$budget = $this->getRandomBudget();
$piggy = $this->getRandomPiggyBank();
$bill = $this->getRandomBill();
$foreignCurrency = $this->getDollar();
$ranges = [new Carbon];
$recurrence = $this->getRandomRecurrence();
// mock calls:
@@ -91,7 +90,7 @@ class RecurrenceTransformerTest extends TestCase
$result = $transformer->transform($recurrence);
$this->assertEquals($recurrence->id, $result['id']);
$this->assertEquals('withdrawal', $result['transaction_type']);
//$this->assertEquals('deposit', $result['transaction_type']);
$this->assertEquals(true, $result['apply_rules']);
$this->assertEquals('Rep descr', $result['recurrence_repetitions'][0]['description']);