Skip to content

Commit

Permalink
added setName method to provider model class
Browse files Browse the repository at this point in the history
  • Loading branch information
ojhaujjwal committed Aug 27, 2014
1 parent 8b1606b commit 9393ae0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions src/Model/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ public function getId()
return $this->id;
}

/**
* Sets Provider name
*
* @param string $name
* @return self
*/
public function setName($name)
{
$this->name = $name;

return $this;
}

/**
* {@inheritDoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/OauthClientTest/Doctrine/UserProviderManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testFindByUser()
$userProviderManager = new UserProviderManager($objectManager, $class);

$userProvider = $this->getMock('Hrevert\OauthClient\Model\UserProvider');
$userProviders = [new UserProvider, $userProvider]();
$userProviders = [new UserProvider, $userProvider];
$user = $this->getMock('Hrevert\OauthClient\Model\UserInterface');

$repository->expects($this->once())
Expand Down
4 changes: 2 additions & 2 deletions tests/OauthClientTest/Model/ProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

class ProviderTest extends \PHPUnit_Framework_TestCase
{
public function testGetters()
public function testSettersAndGetters()
{
$provider = new Provider();

Property::set($provider, 'id', 105);
Property::set($provider, 'name', 'Twitter');
$provider->setName('Twitter');

$this->assertEquals(105, $provider->getId());
$this->assertEquals('Twitter', $provider->getName());
Expand Down

0 comments on commit 9393ae0

Please sign in to comment.