Пример #1
0
 protected function setUp()
 {
     Facebook::setAppId(FB_TEST_APP_ID);
     Facebook::setAppSecret(FB_TEST_APP_SECRET);
 }
Пример #2
0
 /**
  * Update user's name and/or password
  *
  * @link https://developers.facebook.com/docs/test_users/#changepw
  * @param array $properties an attributes to be changed. Only name and password
  * supported so far
  * @return bool
  * @throws \InvalidArgumentException if parameters are empty, or contain bad parameter
  */
 public function update(array $properties)
 {
     $changeable = array('name', 'password');
     $diff = array_diff_key($properties, array_flip($changeable));
     if (array() !== $diff) {
         $error = 'Cannot change ' . implode(', ', array_keys($diff));
         throw new \InvalidArgumentException($error);
     } elseif (empty($properties)) {
         throw new \InvalidArgumentException('Properties cannot be empty');
     }
     $success = static::getClient()->post($this->id, null, array_merge(array('access_token' => Facebook::getAppAccessToken()), $properties))->send()->json();
     if ($success) {
         $this->profile = array_merge($properties, $this->profile);
         return true;
     }
 }
Пример #3
0
 /**
  * @expectedException LogicException
  */
 public function testGetAppSecretException()
 {
     Facebook::getAppSecret();
 }