Exemple #1
0
 public static function __callStatic($name, array $args = [])
 {
     if (strpos($name, 'get') === 0) {
         $sdk = new Sdk($args);
         return $sdk->getClient(substr($name, 3), isset($args[0]) ? $args[0] : []);
     }
     throw new BadMethodCallException("Unknown method: {$name}.");
 }
 public function testCreatesClients()
 {
     $this->assertInstanceOf('SellerCenter\\SDK\\Common\\SdkClientInterface', (new Sdk())->getProduct(['store' => 'mobly-br', 'environment' => 'staging', 'credentials' => ['id' => '*****@*****.**', 'key' => '1234567890123456789012345678901234567890']]));
     $this->assertInstanceOf('SellerCenter\\SDK\\Common\\SdkClientInterface', Sdk::getProduct(['store' => 'mobly-br', 'environment' => 'staging', 'credentials' => ['id' => '*****@*****.**', 'key' => '1234567890123456789012345678901234567890']]));
 }