From 9393ae0d20809149e6e79685d4071b12e88752b7 Mon Sep 17 00:00:00 2001 From: Ujjwal Ojha Date: Wed, 27 Aug 2014 15:10:20 +0545 Subject: [PATCH] added setName method to provider model class --- src/Model/Provider.php | 13 +++++++++++++ .../Doctrine/UserProviderManagerTest.php | 2 +- tests/OauthClientTest/Model/ProviderTest.php | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Model/Provider.php b/src/Model/Provider.php index c484d3c..a07c9d4 100644 --- a/src/Model/Provider.php +++ b/src/Model/Provider.php @@ -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} */ diff --git a/tests/OauthClientTest/Doctrine/UserProviderManagerTest.php b/tests/OauthClientTest/Doctrine/UserProviderManagerTest.php index 43ce958..b343647 100644 --- a/tests/OauthClientTest/Doctrine/UserProviderManagerTest.php +++ b/tests/OauthClientTest/Doctrine/UserProviderManagerTest.php @@ -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()) diff --git a/tests/OauthClientTest/Model/ProviderTest.php b/tests/OauthClientTest/Model/ProviderTest.php index adfe34a..d75481d 100644 --- a/tests/OauthClientTest/Model/ProviderTest.php +++ b/tests/OauthClientTest/Model/ProviderTest.php @@ -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());