示例#1
0
 public function testRelaysMethodsToInternalOAuthInstance()
 {
     $this->markTestIncomplete('Problem with resolving classes for mocking');
     $oauth = $this->getMock('Zend\\OAuth\\Consumer', array(), array(), '', false);
     $oauth->expects($this->once())->method('getRequestToken')->will($this->returnValue('foo'));
     $oauth->expects($this->once())->method('getRedirectUrl')->will($this->returnValue('foo'));
     $oauth->expects($this->once())->method('redirect')->will($this->returnValue('foo'));
     $oauth->expects($this->once())->method('getAccessToken')->will($this->returnValue('foo'));
     $oauth->expects($this->once())->method('getToken')->will($this->returnValue('foo'));
     $twitter = new Service\Twitter(array('opt1' => 'val1'), $oauth);
     $this->assertEquals('foo', $twitter->getRequestToken());
     $this->assertEquals('foo', $twitter->getRedirectUrl());
     $this->assertEquals('foo', $twitter->redirect());
     $this->assertEquals('foo', $twitter->getAccessToken(array(), $this->getMock('Zend\\OAuth\\Token\\Request')));
     $this->assertEquals('foo', $twitter->getToken());
 }