コード例 #1
0
ファイル: OAuthTest.php プロジェクト: widop/twitter-oauth
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->httpAdapter = $this->getMock('Widop\\HttpAdapter\\HttpAdapterInterface');
     $this->consumer = $this->getMockBuilder('Widop\\Twitter\\OAuth\\OAuthConsumer')->disableOriginalConstructor()->getMock();
     $this->consumer->expects($this->any())->method('getKey')->will($this->returnValue('consumer_key'));
     $this->consumer->expects($this->any())->method('getSecret')->will($this->returnValue('consumer_secret'));
     $this->signature = $this->getMock('Widop\\Twitter\\OAuth\\Signature\\OAuthSignatureInterface');
     $this->signature->expects($this->any())->method('generate')->with($this->isInstanceOf('Widop\\Twitter\\OAuth\\OAuthRequest'), $this->equalTo('consumer_secret'))->will($this->returnValue('signature'));
     $this->signature->expects($this->any())->method('getName')->will($this->returnValue('signature-name'));
     $this->oauth = new OAuth($this->httpAdapter, $this->consumer, $this->signature);
 }
コード例 #2
0
 public function testSecret()
 {
     $this->consumer->setSecret('foo');
     $this->assertSame('foo', $this->consumer->getSecret());
 }