getMockClientCredentials()); $this->assertEquals('clientsecret&', $signature->sign($uri = 'http://www.example.com/')); $signature->setCredentials($this->getMockCredentials()); $this->assertEquals('clientsecret&tokensecret', $signature->sign($uri)); $this->assertEquals('PLAINTEXT', $signature->method()); } protected function getMockClientCredentials() { $clientCredentials = m::mock('League\OAuth1\Client\Credentials\ClientCredentialsInterface'); $clientCredentials->shouldReceive('getSecret')->andReturn('clientsecret'); return $clientCredentials; } protected function getMockCredentials() { $credentials = m::mock('League\OAuth1\Client\Credentials\CredentialsInterface'); $credentials->shouldReceive('getSecret')->andReturn('tokensecret'); return $credentials; } }