RedUNIT\Base\Misc::testFUSEnested PHP Method

testFUSEnested() public method

Test nested FUSE scenarios.
public testFUSEnested ( ) : void
return void
    public function testFUSEnested()
    {
        testpack('FUSE models cant touch nested beans in update() - issue 106');
        $spoon = R::dispense('spoon');
        $spoon->name = 'spoon for test bean';
        $deep = R::dispense('deep');
        $deep->name = 'deepbean';
        $item = R::dispense('item');
        $item->val = 'Test';
        $item->deep = $deep;
        $test = R::dispense('test');
        $test->item = $item;
        $test->sharedSpoon[] = $spoon;
        $test->isnowtainted = TRUE;
        $id = R::store($test);
        $test = R::load('test', $id);
        asrt($test->item->val, 'Test2');
        $can = reset($test->ownCan);
        $spoon = reset($test->sharedSpoon);
        asrt($can->name, 'can for bean');
        asrt($spoon->name, 'S2');
        asrt($test->item->deep->name, '123');
        asrt(count($test->ownCan), 1);
        asrt(count($test->sharedSpoon), 1);
        asrt(count($test->sharedPeas), 10);
        asrt(count($test->ownChip), 9);
    }