public function testCols() { $select = new Select('project'); $select->cols('user_id', 'project_id', 'name'); $this->assertCount(3, $select->getColumns()); $select->cols(["uid" => "user_id", "pid" => "project_id", "name"]); $c = $select->getColumns(); $this->assertCount(3, $c); $this->assertInstanceOf('\\RBM\\SqlQuery\\Column', $c[0]); $this->assertInstanceOf('\\RBM\\SqlQuery\\Column', $c[1]); $this->assertInstanceOf('\\RBM\\SqlQuery\\Column', $c[2]); $this->assertEquals('uid', $c[0]->getAlias()); $this->assertEquals('pid', $c[1]->getAlias()); $this->assertNull($c[2]->getAlias()); $this->assertEquals('user_id', $c[0]->getName()); $this->assertEquals('project_id', $c[1]->getName()); $this->assertEquals('name', $c[2]->getName()); }