atk4\data\tests\JoinArrayTest::testJoinSaving3 PHP Method

testJoinSaving3() public method

public testJoinSaving3 ( )
    public function testJoinSaving3()
    {
        $a = ['user' => [], 'contact' => []];
        $db = new Persistence_Array($a);
        $m_u = new Model($db, 'user');
        $m_u->addField('name');
        $j = $m_u->join('contact', 'test_id');
        $j->addField('contact_phone');
        $m_u['name'] = 'John';
        $m_u['contact_phone'] = '+123';
        $m_u->save();
        $this->assertEquals(['user' => [1 => ['id' => 1, 'test_id' => 1, 'name' => 'John']], 'contact' => [1 => ['id' => 1, 'contact_phone' => '+123']]], $a);
    }