Skip to content

Commit

Permalink
fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nojimage committed May 11, 2012
1 parent d1101a4 commit d5ca00a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/cases/behaviors/twitter.test.php
Expand Up @@ -110,7 +110,7 @@ function testSetTwitterSource() {
function testTwitterAuthorizedUrl() {
$callback = Router::url('/twitter_kit/oauth/callback', true);
$result = $this->TestModel->twitterAuthorizeUrl($callback);
$this->assertPattern('!http://api\.twitter\.com/oauth/authorize\?oauth_token=.+!', $result);
$this->assertPattern('!https://api\.twitter\.com/oauth/authorize\?oauth_token=.+!', $result);

// for testGetOAuthAccessToken
debug($result);
Expand All @@ -119,7 +119,7 @@ function testTwitterAuthorizedUrl() {
function testTwitterAuthenticateUrl() {
$callback = Router::url('/twitter_kit/oauth/callback', true);
$result = $this->TestModel->twitterAuthenticateUrl($callback);
$this->assertPattern('!http://api\.twitter\.com/oauth/authenticate\?oauth_token=.+!', $result);
$this->assertPattern('!https://api\.twitter\.com/oauth/authenticate\?oauth_token=.+!', $result);
}

function testTwitterAccessToken() {
Expand Down
8 changes: 4 additions & 4 deletions tests/cases/components/twitter_component.test.php
Expand Up @@ -142,7 +142,7 @@ function testSetDataSource() {
function testGetAuthorizedUrl() {
$callback = Router::url('/twitter_kit/oauth/callback', true);
$result = $this->TestComponent->getAuthorizeUrl($callback);
$this->assertPattern('!http://api\.twitter\.com/oauth/authorize\?oauth_token=.+!', $result);
$this->assertPattern('!https://api\.twitter\.com/oauth/authorize\?oauth_token=.+!', $result);

// for testGetAccessToken
debug($result);
Expand All @@ -151,7 +151,7 @@ function testGetAuthorizedUrl() {
function testGetAuthenticateUrl() {
$callback = Router::url('/twitter_kit/oauth/callback', true);
$result = $this->TestComponent->getAuthenticateUrl($callback);
$this->assertPattern('!http://api\.twitter\.com/oauth/authenticate\?oauth_token=.+!', $result);
$this->assertPattern('!https://api\.twitter\.com/oauth/authenticate\?oauth_token=.+!', $result);
}

function testGetAccessToken() {
Expand Down Expand Up @@ -224,13 +224,13 @@ function testSetTokenByUser() {
// =========================================================================
function testConnect() {
$this->TestComponent->connect();
$this->assertPattern('!http://api\.twitter\.com/oauth/authenticate\?oauth_token=.+!', $this->TestComponent->controller->redirectUrl);
$this->assertPattern('!https://api\.twitter\.com/oauth/authenticate\?oauth_token=.+!', $this->TestComponent->controller->redirectUrl);
}

function testConnect_authorize() {
$this->TestComponent->controller->params['named']['authorize'] = 'true';
$this->TestComponent->connect();
$this->assertPattern('!http://api\.twitter\.com/oauth/authorize\?oauth_token=.+!', $this->TestComponent->controller->redirectUrl);
$this->assertPattern('!https://api\.twitter\.com/oauth/authorize\?oauth_token=.+!', $this->TestComponent->controller->redirectUrl);
}

}

0 comments on commit d5ca00a

Please sign in to comment.