1: <?php
2:
3: namespace Alchemy\tests;
4: use Alchemy\core\schema\Table;
5: use Alchemy\core\query\Query;
6: use Alchemy\dialect\ANSICompiler;
7:
8:
9: class ANSIUpdateTest extends BaseTest {
10:
11: public function testSimpleUpdate() {
12: $users = Table::Core('users', array(
13: 'columns' => array(
14: 'UserName' => 'String',
15: 'Email' => 'String')
16: ));
17:
18: $users = $users->getRef();
19:
20: $query = Query::Update($users)
21: ->columns(array(
22: 'UserName' => "user1",
23: 'Email' => "user1@example.com"))
24: ->where($users->Email->equal("user2@example.com"));
25:
26: $ansi = new ANSICompiler();
27: $vern = $ansi->compile($query, array('alias_tables' => true));
28:
29: $this->assertExpectedString('ANSIUpdateTest-1.sql', $vern);
30: }
31: }
32: