Changeset View
Changeset View
Standalone View
Standalone View
src/future/oauth/__tests__/PhutilOAuth1FutureTestCase.php
| Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | $future = id(new PhutilOAuth1Future($uri, $data)) | ||||
| ->setTimestamp(1318622958) | ->setTimestamp(1318622958) | ||||
| ->setToken('370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb') | ->setToken('370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb') | ||||
| ->setTokenSecret('LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE'); | ->setTokenSecret('LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE'); | ||||
| $this->assertEqual('tnnArxj06cWHq44gCs1OSKk/jLY=', $future->getSignature()); | $this->assertEqual('tnnArxj06cWHq44gCs1OSKk/jLY=', $future->getSignature()); | ||||
| } | } | ||||
| public function testOAuth1SigningWithJIRAExamples() { | public function testOAuth1SigningWithJIRAExamples() { | ||||
| if (!function_exists('openssl_pkey_get_private')) { | |||||
| $this->assertSkipped( | |||||
| pht('Required "openssl" extension is not installed.')); | |||||
| } | |||||
| // NOTE: This is an emprically example against JIRA v6.0.6, in that the | // NOTE: This is an emprically example against JIRA v6.0.6, in that the | ||||
| // code seems to work when actually authing. It primarily serves as a check | // code seems to work when actually authing. It primarily serves as a check | ||||
| // of the RSA-SHA1 signature method. | // of the RSA-SHA1 signature method. | ||||
| $public_key = <<<EOKEY | $public_key = <<<EOKEY | ||||
| -----BEGIN PUBLIC KEY----- | -----BEGIN PUBLIC KEY----- | ||||
| MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAz/cLggl8VtHsZAtQudfz | MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAz/cLggl8VtHsZAtQudfz | ||||
| ▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines | |||||