lithium\tests\cases\data\source\DatabaseTest::testUpdateWithValueBySchema PHP Method

testUpdateWithValueBySchema() public method

    public function testUpdateWithValueBySchema()
    {
        $entity = new Record(array('model' => $this->_model, 'data' => array('id' => 1, 'title' => '007', 'body' => 'the body'), 'exists' => true));
        $query = new Query(compact('entity') + array('type' => 'update'));
        $result = $this->_db->update($query);
        $this->assertTrue($result);
        $this->assertEqual(1, $query->entity()->id);
        $expected = "UPDATE {mock_database_posts} SET";
        $expected .= " {id} = 1, {title} = '007', {body} = 'the body' WHERE {id} = 1;";
        $this->assertEqual($expected, $this->_db->sql);
    }
DatabaseTest