Use Interfaces anywhere.
In practice, there were still too many concrete classes, which makes integration into a framework hard. To overcome this, the codebase has been refactored to use Interfaces when a resource is needed. All necessary Interfaces have been created, and the existing concrete classes now implement these interfaces.
This commit is contained in:
20
tests/ConsumerTest.php
Normal file
20
tests/ConsumerTest.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use JacobKiers\OAuth\Consumer\Consumer;
|
||||
|
||||
class ConsumerTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testKeyAndSecretAreSet()
|
||||
{
|
||||
$consumer = new consumer('foo', 'bar');
|
||||
$this->assertEquals('foo', $consumer->getKey());
|
||||
$this->assertEquals('bar', $consumer->getSecret());
|
||||
}
|
||||
|
||||
public function testCallbackUrlIsSet()
|
||||
{
|
||||
$consumer = new consumer('foo', 'bar', 'http://example.com/foobar');
|
||||
$this->assertEquals('http://example.com/foobar', $consumer->getCallbackUrl());
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user