Phalcon\Test\Unit\Http\RequestTest::testRequestGetQuery PHP Метод

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

public testRequestGetQuery ( )
    public function testRequestGetQuery()
    {
        $_REQUEST = $_GET = $_POST = ['id' => 1, 'num' => 'a1a', 'age' => 'aa', 'phone' => ''];
        $this->specify("Request::getQuery does not return correct result", function ($function) {
            $request = $this->getRequestObject();
            expect($request->{$function}('id', 'int', 100))->equals(1);
            expect($request->{$function}('num', 'int', 100))->equals(1);
            expect($request->{$function}('age', 'int', 100))->isEmpty();
            expect($request->{$function}('phone', 'int', 100))->isEmpty();
            expect($request->{$function}('phone', 'int', 100, true))->equals(100);
        }, ['examples' => [['get', 'getQuery', 'getPost']]]);
    }