tests/UnitTests/POData/UriProcessor/QueryProcessor/SkipTokenParser/SkipTokenParserTest.php
/**
     * Test the initialization of orderbyinfo's dummy object from the skiptoken value.
     * 1. Complex navigation can be also used in the skiptoken  
     * 2. The lexer will consider all token text as string, but when the we populate the
     *    dummy object with these values, it should be converted to appropriate type 
     *  
     */
Test the initialization of orderbyinfo's dummy object from the skiptoken value.
1. Complex navigation can be also used in the skiptoken
2. The lexer will consider all token text as string, but when the we populate the
dummy object with these values, it should be converted to appropriate type
Test the initialization of orderbyinfo ' s dummy object from the skiptoken value . 1 . Complex navigation can be also used in the skiptoken 2 . The lexer will consider all token text as string but when the we populate the dummy object with these values it should be converted to appropriate type
public function testInitializationOfKeyObject3()
    {
        $northWindMetadata = NorthWindMetadata::Create();
        $configuration = new ServiceConfiguration($northWindMetadata);
        $configuration->setEntitySetAccessRule('*', EntitySetRights::ALL);
        $providersWrapper = new ProvidersWrapper(
                                $northWindMetadata, 
						        $this->mockQueryProvider,
                                $configuration, 
                                false
                                );
        $resourceSetWrapper = $providersWrapper->resolveResourceSet('Customers');
        $resourceType = $resourceSetWrapper->getResourceType();
        $orderBy = 'Address/IsValid';
        $orderBy .= ',CustomerID';
        $internalOrderByInfo = OrderByParser::parseOrderByClause($resourceSetWrapper, $resourceType, $orderBy, $providersWrapper);
        $skipToken = "true, 'ALFKI'";
        $dummyObject = $internalOrderByInfo->getDummyObject();
        $internalSkipTokenInfo = SkipTokenParser::parseSkipTokenClause($resourceType, $internalOrderByInfo, $skipToken);
        $keyObject = $internalSkipTokenInfo->getKeyObject();
        $this->assertTrue(!is_null($keyObject));
        $this->assertTrue(!is_null($keyObject->Address));
        $this->assertTrue(!is_null($keyObject->Address->IsValid));
        $this->assertTrue($keyObject->Address->IsValid);
    }
public function testInitializationOfKeyObject3 ( ) { $ northWindMetadata = NorthWindMetadata :: Create ( ) ; $ configuration = new ServiceConfiguration ( $ northWindMetadata ) ; $ configuration -> setEntitySetAccessRule ( '*' , EntitySetRights :: ALL ) ; $ providersWrapper = new ProvidersWrapper ( $ northWindMetadata , $ this -> mockQueryProvider , $ configuration , false ) ; $ resourceSetWrapper = $ providersWrapper -> resolveResourceSet ( 'Customers' ) ; $ resourceType = $ resourceSetWrapper -> getResourceType ( ) ; $ orderBy = 'Address/IsValid' ; $ orderBy .= ',CustomerID' ; $ internalOrderByInfo = OrderByParser :: parseOrderByClause ( $ resourceSetWrapper , $ resourceType , $ orderBy , $ providersWrapper ) ; $ skipToken = " true, 'ALFKI' " ; $ dummyObject = $ internalOrderByInfo -> getDummyObject ( ) ; $ internalSkipTokenInfo = SkipTokenParser :: parseSkipTokenClause ( $ resourceType , $ internalOrderByInfo , $ skipToken ) ; $ keyObject = $ internalSkipTokenInfo -> getKeyObject ( ) ; $ this -> assertTrue ( ! is_null ( $ keyObject ) ) ; $ this -> assertTrue ( ! is_null ( $ keyObject -> Address ) ) ; $ this -> assertTrue ( ! is_null ( $ keyObject -> Address -> IsValid ) ) ; $ this -> assertTrue ( $ keyObject -> Address -> IsValid ) ; }
Test the initialization of orderbyinfo's dummy object from the skiptoken value.
Test the initialization of orderbyinfo ' s dummy object from the skiptoken value .
//IMetadataProvider implementation //Service configuuration //Note: library will add primery key as last sort key //test with other values, double, guid, int, datetime        