function testSetTokenByUser()
 {
     $user = array('User' => array('oauth_token' => 'dummy_token', 'oauth_token_secret' => 'dummy_secret'));
     $result = $this->TestComponent->setTokenByUser($user);
     $this->assertEqual('dummy_token', $this->TestComponent->DataSource->oauth_token);
     $this->assertEqual('dummy_secret', $this->TestComponent->DataSource->oauth_token_secret);
     $this->TestComponent->settings['fields']['oauth_token'] = 'accsess_token';
     $this->TestComponent->settings['fields']['oauth_token_secret'] = 'accsess_token_secret';
     $user = array('User' => array('accsess_token' => 'dummy_token2', 'accsess_token_secret' => 'dummy_secret2'));
     $result = $this->TestComponent->setTokenByUser($user);
     $this->assertEqual('dummy_token2', $this->TestComponent->DataSource->oauth_token);
     $this->assertEqual('dummy_secret2', $this->TestComponent->DataSource->oauth_token_secret);
 }
 function testConnect_authorize()
 {
     $this->TestComponent->controller->params['named']['authorize'] = 'true';
     $this->TestComponent->connect();
     $this->assertPattern('!https://api\\.twitter\\.com/oauth/authorize\\?oauth_token=.+!', $this->TestComponent->controller->redirectUrl);
 }
 public function testGetType()
 {
     $component = new TestComponent();
     $this->assertEquals('testtype', $component->getType());
 }