diff --git a/tests/ClientTest.php b/tests/ClientTest.php new file mode 100644 index 0000000..084c88f --- /dev/null +++ b/tests/ClientTest.php @@ -0,0 +1,20 @@ +assertEquals('foo', $client->getKey()); + $this->assertEquals('bar', $client->getSecret()); + } + + public function testCallbackUrlIsSet() + { + $client = new Client('foo', 'bar', 'http://example.com/foobar'); + $this->assertEquals('http://example.com/foobar', $client->getCallbackUrl()); + } + +} diff --git a/tests/TokenTest.php b/tests/TokenTest.php new file mode 100644 index 0000000..f9e24aa --- /dev/null +++ b/tests/TokenTest.php @@ -0,0 +1,22 @@ +assertEquals('foo', $token->getKey()); + $this->assertEquals('bar', $token->getSecret()); + } + + public function testTokenString() + { + $token = new Token('foo', 'bar'); + $string = 'oauth_token=' . Util::urlencodeRfc3986('foo') . + '&oauth_token_secret=' . Util::urlencodeRfc3986('bar'); + $this->assertEquals($string, $token->toString()); + } +}