mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix tests.
This commit is contained in:
parent
0c1ff98c66
commit
63d93968d0
@ -93,7 +93,7 @@ final class Entry
|
|||||||
*
|
*
|
||||||
* @return Entry
|
* @return Entry
|
||||||
*/
|
*/
|
||||||
public static function fromTransaction(Transaction $transaction): self
|
public static function fromTransaction(Transaction $transaction): Entry
|
||||||
{
|
{
|
||||||
$entry = new self;
|
$entry = new self;
|
||||||
$entry->journal_id = $transaction->journal_id;
|
$entry->journal_id = $transaction->journal_id;
|
||||||
|
@ -40,40 +40,40 @@ interface ReportGeneratorInterface
|
|||||||
*
|
*
|
||||||
* @return ReportGeneratorInterface
|
* @return ReportGeneratorInterface
|
||||||
*/
|
*/
|
||||||
public function setAccounts(Collection $accounts): self;
|
public function setAccounts(Collection $accounts): ReportGeneratorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection $budgets
|
* @param Collection $budgets
|
||||||
*
|
*
|
||||||
* @return ReportGeneratorInterface
|
* @return ReportGeneratorInterface
|
||||||
*/
|
*/
|
||||||
public function setBudgets(Collection $budgets): self;
|
public function setBudgets(Collection $budgets): ReportGeneratorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection $categories
|
* @param Collection $categories
|
||||||
*
|
*
|
||||||
* @return ReportGeneratorInterface
|
* @return ReportGeneratorInterface
|
||||||
*/
|
*/
|
||||||
public function setCategories(Collection $categories): self;
|
public function setCategories(Collection $categories): ReportGeneratorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
*
|
*
|
||||||
* @return ReportGeneratorInterface
|
* @return ReportGeneratorInterface
|
||||||
*/
|
*/
|
||||||
public function setEndDate(Carbon $date): self;
|
public function setEndDate(Carbon $date): ReportGeneratorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
*
|
*
|
||||||
* @return ReportGeneratorInterface
|
* @return ReportGeneratorInterface
|
||||||
*/
|
*/
|
||||||
public function setStartDate(Carbon $date): self;
|
public function setStartDate(Carbon $date): ReportGeneratorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection $tags
|
* @param Collection $tags
|
||||||
*
|
*
|
||||||
* @return ReportGeneratorInterface
|
* @return ReportGeneratorInterface
|
||||||
*/
|
*/
|
||||||
public function setTags(Collection $tags): self;
|
public function setTags(Collection $tags): ReportGeneratorInterface;
|
||||||
}
|
}
|
||||||
|
@ -44,54 +44,54 @@ interface MetaPieChartInterface
|
|||||||
*
|
*
|
||||||
* @return MetaPieChartInterface
|
* @return MetaPieChartInterface
|
||||||
*/
|
*/
|
||||||
public function setAccounts(Collection $accounts): self;
|
public function setAccounts(Collection $accounts): MetaPieChartInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection $budgets
|
* @param Collection $budgets
|
||||||
*
|
*
|
||||||
* @return MetaPieChartInterface
|
* @return MetaPieChartInterface
|
||||||
*/
|
*/
|
||||||
public function setBudgets(Collection $budgets): self;
|
public function setBudgets(Collection $budgets): MetaPieChartInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection $categories
|
* @param Collection $categories
|
||||||
*
|
*
|
||||||
* @return MetaPieChartInterface
|
* @return MetaPieChartInterface
|
||||||
*/
|
*/
|
||||||
public function setCategories(Collection $categories): self;
|
public function setCategories(Collection $categories): MetaPieChartInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param bool $collectOtherObjects
|
* @param bool $collectOtherObjects
|
||||||
*
|
*
|
||||||
* @return MetaPieChartInterface
|
* @return MetaPieChartInterface
|
||||||
*/
|
*/
|
||||||
public function setCollectOtherObjects(bool $collectOtherObjects): self;
|
public function setCollectOtherObjects(bool $collectOtherObjects): MetaPieChartInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Carbon $end
|
* @param Carbon $end
|
||||||
*
|
*
|
||||||
* @return MetaPieChartInterface
|
* @return MetaPieChartInterface
|
||||||
*/
|
*/
|
||||||
public function setEnd(Carbon $end): self;
|
public function setEnd(Carbon $end): MetaPieChartInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
*
|
*
|
||||||
* @return MetaPieChartInterface
|
* @return MetaPieChartInterface
|
||||||
*/
|
*/
|
||||||
public function setStart(Carbon $start): self;
|
public function setStart(Carbon $start): MetaPieChartInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection $tags
|
* @param Collection $tags
|
||||||
*
|
*
|
||||||
* @return MetaPieChartInterface
|
* @return MetaPieChartInterface
|
||||||
*/
|
*/
|
||||||
public function setTags(Collection $tags): self;
|
public function setTags(Collection $tags): MetaPieChartInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param User $user
|
* @param User $user
|
||||||
*
|
*
|
||||||
* @return MetaPieChartInterface
|
* @return MetaPieChartInterface
|
||||||
*/
|
*/
|
||||||
public function setUser(User $user): self;
|
public function setUser(User $user): MetaPieChartInterface;
|
||||||
}
|
}
|
||||||
|
@ -45,5 +45,5 @@ interface FileProcessorInterface
|
|||||||
*
|
*
|
||||||
* @return FileProcessorInterface
|
* @return FileProcessorInterface
|
||||||
*/
|
*/
|
||||||
public function setJob(ImportJob $job): self;
|
public function setJob(ImportJob $job): FileProcessorInterface;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ class TransactionMatcher
|
|||||||
*
|
*
|
||||||
* @return TransactionMatcher
|
* @return TransactionMatcher
|
||||||
*/
|
*/
|
||||||
public function setLimit(int $limit): self
|
public function setLimit(int $limit): TransactionMatcher
|
||||||
{
|
{
|
||||||
$this->limit = $limit;
|
$this->limit = $limit;
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ class TransactionMatcher
|
|||||||
*
|
*
|
||||||
* @return TransactionMatcher
|
* @return TransactionMatcher
|
||||||
*/
|
*/
|
||||||
public function setRange(int $range): self
|
public function setRange(int $range): TransactionMatcher
|
||||||
{
|
{
|
||||||
$this->range = $range;
|
$this->range = $range;
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ class TransactionMatcher
|
|||||||
*
|
*
|
||||||
* @return TransactionMatcher
|
* @return TransactionMatcher
|
||||||
*/
|
*/
|
||||||
public function setTriggers(array $triggers): self
|
public function setTriggers(array $triggers): TransactionMatcher
|
||||||
{
|
{
|
||||||
$this->triggers = $triggers;
|
$this->triggers = $triggers;
|
||||||
|
|
||||||
|
@ -550,6 +550,9 @@ class CreateMainTables extends Migration
|
|||||||
$table->integer('transaction_journal_id', false, true);
|
$table->integer('transaction_journal_id', false, true);
|
||||||
$table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade');
|
$table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade');
|
||||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||||
|
|
||||||
|
// unique combi:
|
||||||
|
$table->unique(['tag_id', 'transaction_journal_id']);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -72,13 +72,11 @@ class RemoveTagTest extends TestCase
|
|||||||
public function testActNoTag()
|
public function testActNoTag()
|
||||||
{
|
{
|
||||||
// get journal, link al tags:
|
// get journal, link al tags:
|
||||||
|
/** @var TransactionJournal $journal */
|
||||||
$journal = TransactionJournal::find(11);
|
$journal = TransactionJournal::find(11);
|
||||||
$tags = $journal->user->tags()->get();
|
$tags = $journal->user->tags()->get();
|
||||||
foreach ($tags as $tag) {
|
$journal->tags()->sync($tags->pluck('id')->toArray());
|
||||||
$journal->tags()->save($tag);
|
$this->assertEquals($tags->count(), $journal->tags()->get()->count());
|
||||||
$journal->save();
|
|
||||||
}
|
|
||||||
$this->assertEquals($tags->count(), $journal->tags()->count());
|
|
||||||
|
|
||||||
// fire the action:
|
// fire the action:
|
||||||
$ruleAction = new RuleAction;
|
$ruleAction = new RuleAction;
|
||||||
|
Loading…
Reference in New Issue
Block a user