protected function setUp() { Facebook::setAppId(FB_TEST_APP_ID); Facebook::setAppSecret(FB_TEST_APP_SECRET); }
/** * 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; } }
/** * @expectedException LogicException */ public function testGetAppSecretException() { Facebook::getAppSecret(); }