Phalcon\Test\Unit\Mvc\Model\Query\BuilderTest::testConstructor PHP Метод

testConstructor() публичный Метод

Test checks passing query params and dependency injector into constructor
public testConstructor ( )
    public function testConstructor()
    {
        $this->specify("Query Builders don't work with params in the constructor", function () {
            $di = $this->di;
            $params = ["models" => Robots::class, "columns" => ["id", "name", "status"], "conditions" => "a > 5", "group" => ["type", "source"], "having" => "b < 5", "order" => ["name", "created"], "limit" => 10, "offset" => 15];
            $builder = new Builder($params, $di);
            $expectedPhql = "SELECT id, name, status FROM [" . Robots::class . "] " . "WHERE a > 5 GROUP BY [type], [source] " . "HAVING b < 5 ORDER BY [name], [created] " . "LIMIT :APL0: OFFSET :APL1:";
            expect($expectedPhql)->equals($builder->getPhql());
            expect($di)->equals($builder->getDI());
        });
    }