예제 #1
0
 public function testScopes()
 {
     $client = new Client('AccessToken', 'SecretKey');
     $this->assertEmpty($client->getScopes(), 'By default the scopes should be an empty array');
     $this->assertInternalType('array', $client->getScopes(), 'Expected getScopes to return an array');
     $client->setScopes(array(Client::SCOPE_READ_CUSTOMERS));
     $this->assertCount(1, $client->getScopes());
     $this->assertInternalType('array', $client->getScopes());
     $client->addScope(Client::SCOPE_WRITE_CUSTOMERS);
     $this->assertCount(2, $client->getScopes());
     $this->assertInternalType('array', $client->getScopes());
 }