user->attachments()->first(); $journal->attachments()->save($attachment); $this->assertEquals(1, $journal->attachments()->count()); $trigger = HasAttachment::makeFromStrings('1', false); $result = $trigger->triggered($journal); $this->assertTrue($result); } /** * @covers \FireflyIII\TransactionRules\Triggers\HasAttachment::triggered */ public function testTriggeredFalse() { $journal = TransactionJournal::find(27); $this->assertEquals(0, $journal->attachments()->count()); $trigger = HasAttachment::makeFromStrings('1', false); $result = $trigger->triggered($journal); $this->assertFalse($result); } /** * @covers \FireflyIII\TransactionRules\Triggers\HasAttachment::willMatchEverything */ public function testWillMatchEverything() { $value = '5'; $result = HasAttachment::willMatchEverything($value); $this->assertFalse($result); } /** * @covers \FireflyIII\TransactionRules\Triggers\HasAttachment::willMatchEverything */ public function testWillMatchEverythingTrue() { $value = -1; $result = HasAttachment::willMatchEverything($value); $this->assertTrue($result); } }