destination_amount = '12.34'; $trigger = AmountLess::makeFromStrings('12.50', false); $result = $trigger->triggered($journal); $this->assertTrue($result); } /** * @covers \FireflyIII\TransactionRules\Triggers\AmountLess::triggered */ public function testTriggeredExact() { $journal = new TransactionJournal; $journal->destination_amount = '12.35'; $trigger = AmountLess::makeFromStrings('12.35', false); $result = $trigger->triggered($journal); $this->assertFalse($result); } /** * @covers \FireflyIII\TransactionRules\Triggers\AmountLess::triggered */ public function testTriggeredNotLess() { $journal = new TransactionJournal; $journal->destination_amount = '12.35'; $trigger = AmountLess::makeFromStrings('12.00', false); $result = $trigger->triggered($journal); $this->assertFalse($result); } /** * @covers \FireflyIII\TransactionRules\Triggers\AmountLess::willMatchEverything */ public function testWillMatchEverythingNotNull() { $value = 'x'; $result = AmountLess::willMatchEverything($value); $this->assertFalse($result); } /** * @covers \FireflyIII\TransactionRules\Triggers\AmountLess::willMatchEverything */ public function testWillMatchEverythingNull() { $value = null; $result = AmountLess::willMatchEverything($value); $this->assertTrue($result); } }