tests/UnitTests/POData/UriProcessor/QueryProcessor/SkipTokenParser/SkipTokenParserTest.php
/**
     * test the creation of nextlink from an object.
     * Test building of link with string sub-value
     */
test the creation of nextlink from an object.
Test building of link with string sub-value
test the creation of nextlink from an object . Test building of link with string sub - value
public function testCreationOfNextLink2()
    {
        $northWindMetadata = NorthWindMetadata::Create();
        $configuration = new ServiceConfiguration($northWindMetadata);
        $configuration->setEntitySetAccessRule('*', EntitySetRights::ALL);
        $providersWrapper = new ProvidersWrapper(
                                    $northWindMetadata, 
							        $this->mockQueryProvider,
                                    $configuration, 
                                    false
                                    );
        $resourceSetWrapper = $providersWrapper->resolveResourceSet('Orders');
        $resourceType = $resourceSetWrapper->getResourceType();
        $orderBy = 'ShipName asc, Price';
        $orderBy .= ', OrderID';
        $internalOrderByInfo = OrderByParser::parseOrderByClause($resourceSetWrapper, $resourceType, $orderBy, $providersWrapper);
        $skipToken = "'ABY',22.000,10365";
        $internalSkipTokenInfo = SkipTokenParser::parseSkipTokenClause($resourceType, $internalOrderByInfo, $skipToken);
        $lastObject = new Order2();
        $lastObject->ShipName = utf8_decode(urldecode('Antonio%20Moreno%20Taquer%C3%ADa'));
        $lastObject->Price = 23.56;
        $lastObject->OrderID = 3456;
        $nextLink = $internalSkipTokenInfo->buildNextPageLink($lastObject);
        $this->assertTrue(!is_null($nextLink));
        $thrownException = false;
        $nextLink = $internalSkipTokenInfo->buildNextPageLink($lastObject);
        $this->assertEquals($nextLink, "'Antonio+Moreno+Taquer%C3%ADa', 23.56D, 3456");
    }
public function testCreationOfNextLink2 ( ) { $ northWindMetadata = NorthWindMetadata :: Create ( ) ; $ configuration = new ServiceConfiguration ( $ northWindMetadata ) ; $ configuration -> setEntitySetAccessRule ( '*' , EntitySetRights :: ALL ) ; $ providersWrapper = new ProvidersWrapper ( $ northWindMetadata , $ this -> mockQueryProvider , $ configuration , false ) ; $ resourceSetWrapper = $ providersWrapper -> resolveResourceSet ( 'Orders' ) ; $ resourceType = $ resourceSetWrapper -> getResourceType ( ) ; $ orderBy = 'ShipName asc, Price' ; $ orderBy .= ', OrderID' ; $ internalOrderByInfo = OrderByParser :: parseOrderByClause ( $ resourceSetWrapper , $ resourceType , $ orderBy , $ providersWrapper ) ; $ skipToken = " 'ABY',22.000,10365 " ; $ internalSkipTokenInfo = SkipTokenParser :: parseSkipTokenClause ( $ resourceType , $ internalOrderByInfo , $ skipToken ) ; $ lastObject = new Order2 ( ) ; $ lastObject -> ShipName = utf8_decode ( urldecode ( 'Antonio%20Moreno%20Taquer%C3%ADa' ) ) ; $ lastObject -> Price = 23.56 ; $ lastObject -> OrderID = 3456 ; $ nextLink = $ internalSkipTokenInfo -> buildNextPageLink ( $ lastObject ) ; $ this -> assertTrue ( ! is_null ( $ nextLink ) ) ; $ thrownException = false ; $ nextLink = $ internalSkipTokenInfo -> buildNextPageLink ( $ lastObject ) ; $ this -> assertEquals ( $ nextLink , " 'Antonio+Moreno+Taquer%C3%ADa', 23.56D, 3456 " ) ; }
test the creation of nextlink from an object.
test the creation of nextlink from an object .
//IMetadataProvider implementation //Service configuration //Note: library will add prim key as last sort key //The string that is fetched from DB can be in utf8 format, so we are building //such a string with utf8_decode