RedUNIT\Base\Association::testFastTrackDeletion PHP Method

testFastTrackDeletion() public method

For link beans.
public testFastTrackDeletion ( ) : void
return void
    public function testFastTrackDeletion()
    {
        testpack('Test fast-track deletion');
        $ghost = R::dispense('ghost');
        $house = R::dispense('house');
        $house->sharedGhost[] = $ghost;
        \Model_Ghost_House::$deleted = FALSE;
        R::getRedBean()->getAssociationManager()->unassociate($house, $ghost);
        // No fast-track, assoc bean got trashed
        asrt(\Model_Ghost_House::$deleted, TRUE);
        \Model_Ghost_House::$deleted = FALSE;
        R::getRedBean()->getAssociationManager()->unassociate($house, $ghost, TRUE);
        // Fast-track, assoc bean got deleted right away
        asrt(\Model_Ghost_House::$deleted, FALSE);
    }