Example #1
0
    /**
     * @covers Zend\Db\Sql\Update::getSqlString
     * @todo   Implement testGetSqlString().
     */
    public function testGetSqlString()
    {
        $this->update->table('foo')
            ->set(array('bar' => 'baz'))
            ->where('x = y');

        $this->assertEquals('UPDATE "foo" SET "bar" = \'baz\' WHERE x = y', $this->update->getSqlString());
    }
Example #2
0
 public function testGenerateSqlForValuesAndSimpleWhere()
 {
     $this->out->table('Test')->values(['super' => 'data', 'next' => 'fieldData'])->where(['id' => 5]);
     $expected = 'UPDATE `[prefix]_Test` SET ' . '`super` = "data",`next` = "fieldData"' . ' WHERE `id` = "5"';
     $this->assertEquals($expected, $this->out->generateSql());
 }