atk4\data\tests\TypecastingTest::testTimestamp PHP Method

testTimestamp() public method

public testTimestamp ( )
    public function testTimestamp()
    {
        $sql_time = '2016-10-25 11:44:08';
        $a = ['types' => [['date' => $sql_time]]];
        $this->setDB($a);
        $db = new Persistence_SQL($this->db->connection);
        $m = new Model($db, ['table' => 'types']);
        $m->addField('ts', ['actual' => 'date', 'type' => 'datetime']);
        $m->loadAny();
        // must respect 'actual'
        $this->assertNotNull($m['ts']);
    }