public function testSelectStatementWithTablesAndJoins() { $table1 = new TableExpression('table1', 't1'); $table2 = new TableExpression('table2_with_long_name', 'table2'); $joinCondition = new SimpleCondition(new FieldExpression('id', $table1), new FieldExpression('id_t1', $table2), '='); $table1->addJoin(new JoinExpression(JoinExpression::TYPE_INNER, $table2, $joinCondition)); $statement = new SelectStatement(); $statement->addField(new FieldExpression('field1', $table1, 'f1')); $statement->addTable($table1); $sql = $this->parser->parseStatement($statement); $this->assertNotNull($sql); $this->assertEquals('SELECT `t1`.`field1` AS `f1` FROM `table1` AS `t1` INNER JOIN `table2_with_long_name` AS `table2` ON `t1`.`id` = `table2`.`id_t1`', $sql); }