예제 #1
0
 /**
  * @return array
  */
 protected function getProperties()
 {
     $properties = [];
     foreach ($this->reflection->getProperties(\ReflectionProperty::IS_PRIVATE) as $property) {
         $property->setAccessible(true);
         $value = $property->getValue($this);
         if (null !== $value) {
             $properties[$property->getName()] = is_array($value) ? json_encode($value) : (string) $value;
         }
     }
     //        print_r($properties);
     //        exit;
     // set access token to method for signature
     if ($access_token = Api::getInstance()->getAccessToken()) {
         $properties[Api::ACCESS_TOKEN] = $access_token;
     }
     $properties[Api::TIMESTAMP_PARAM] = round(microtime(true) * 1000);
     $this->sign = new Sign(new Request($this->method, $this->methodPath, $properties, $this->scheme, $this->api));
     $properties[Api::SIGN_PARAM] = $this->sign->getSign();
     return $properties;
 }
예제 #2
0
 public function getLocaleName()
 {
     return $this->names[Api::getInstance()->getConfigParams('system.locale')];
 }
예제 #3
0
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->api = Api::getInstance();
 }