public static function tmptostring($value)
 {
     if (is_null($value)) {
         return 'null';
     } else {
         if (is_bool($value)) {
             return $value == true ? 'true' : 'false';
         } else {
             if ($value instanceof \DateTime) {
                 return Utilities::convertToEdmDateTime($value);
             } else {
                 if ($value instanceof Entity) {
                     return self::entityToString($value);
                 } else {
                     if (is_array($value)) {
                         return self::entityPropsToString($value);
                     } else {
                         if ($value instanceof Filter) {
                             return TableServiceFunctionalTestUtils::filtertoString($value);
                         } else {
                             return $value;
                         }
                     }
                 }
             }
         }
     }
 }
 /**
  * @covers WindowsAzure\Table\TableRestProxy::updateEntity
  */
 private function createTargetEntity($table, $initialEnt, $concurType, $mutatePivot)
 {
     $targetEnt = TableServiceFunctionalTestUtils::cloneEntity($initialEnt);
     // Update the entity/table state to get the requested concurrency type error.
     switch ($concurType) {
         case ConcurType::NoKeyMatch:
             // Mutate the keys to not match.
             $targetEnt->setRowKey(TableServiceFunctionalTestData::getNewKey());
             break;
         case ConcurType::KeyMatchNoEtag:
             $targetEnt->setEtag(null);
             break;
         case ConcurType::KeyMatchEtagMismatch:
             $newEtag = $this->restProxy->updateEntity($table, $initialEnt)->getEtag();
             $initialEnt->setEtag($newEtag);
             // Now the $targetEnt Etag will not match.
             $this->assertTrue($targetEnt->getEtag() != $initialEnt->getEtag(), 'targetEnt->Etag(\'' . $targetEnt->getEtag() . '\') !=  updated->Etag(\'' . $initialEnt->getEtag() . '\')');
             break;
         case ConcurType::KeyMatchEtagMatch:
             // Don't worry here.
             break;
     }
     // Mutate the properties.
     TableServiceFunctionalTestUtils::mutateEntity($targetEnt, $mutatePivot);
     return $targetEnt;
 }
 private function verifyqueryEntitiesWorker($ret, $options)
 {
     $this->assertNotNull($ret->getEntities(), 'getTables');
     $expectedData = array();
     foreach (self::$entitiesInTable as $e) {
         array_push($expectedData, $e);
     }
     sort($expectedData);
     $projected = false;
     if (!is_null($options->getNextPartitionKey()) && !is_null($options->getNextRowKey())) {
         $expectedDataTmp = array();
         foreach ($expectedData as $e) {
             if ($e->getPartitionKey() > $options->getNextPartitionKey() || $e->getPartitionKey() == $options->getNextPartitionKey() && $e->getRowKey() >= $options->getNextRowKey()) {
                 array_push($expectedDataTmp, $e);
             }
         }
         $expectedData = $expectedDataTmp;
     }
     $q = $options->getQuery();
     $expectedFilter = $q->getFilter();
     $projected = count($q->getSelectFields()) != 0;
     $expectedData = TableServiceFunctionalTestUtils::filterEntityList($expectedFilter, $expectedData);
     if (!is_null($q->getTop()) && $q->getTop() < count($expectedData)) {
         $expectedDataTmp = array();
         for ($i = 0; $i < $q->getTop(); $i++) {
             array_push($expectedDataTmp, $expectedData[$i]);
         }
         $expectedData = $expectedDataTmp;
     }
     $this->compareEntityLists($ret->getEntities(), $expectedData, $projected);
 }