atk4\data\tests\smbo\TransferTest::testTransfer PHP Method

testTransfer() public method

Testing transfer between two accounts.
public testTransfer ( )
    public function testTransfer()
    {
        $aib = (new Account($this->db))->save('AIB');
        $boi = (new Account($this->db))->save('BOI');
        $t = $aib->transfer($boi, 100);
        // create transfer between accounts
        $t->save();
        $this->assertEquals(-100, $aib->reload()['balance']);
        $this->assertEquals(100, $boi->reload()['balance']);
        $data = $t->export(['id', 'transfer_document_id']);
        $this->assertEquals([['id' => '1', 'transfer_document_id' => '2'], ['id' => '2', 'transfer_document_id' => '1']], $data);
    }
TransferTest