diff options
-rw-r--r-- | lib/Service/ShareService.php | 26 | ||||
-rw-r--r-- | tests/Unit/Service/ShareServiceTest.php | 10 |
2 files changed, 18 insertions, 18 deletions
diff --git a/lib/Service/ShareService.php b/lib/Service/ShareService.php index e95fe673b..2b4edafac 100644 --- a/lib/Service/ShareService.php +++ b/lib/Service/ShareService.php @@ -49,7 +49,7 @@ class ShareService /** * @var IURLGenerator */ - private $url; + private $urlGenerator; /** * @var IL10N @@ -59,24 +59,24 @@ class ShareService /** * ShareService constructor * - * @param FeedServiceV2 $feedService Service for feeds - * @param ItemServiceV2 $itemService Service to manage items - * @param IURLGenerator $url URL Generator - * @param IL10N $l Localization interface - * @param LoggerInterface $logger Logger + * @param FeedServiceV2 $feedService Service for feeds + * @param ItemServiceV2 $itemService Service to manage items + * @param IURLGenerator $urlGenerator URL Generator + * @param IL10N $l Localization interface + * @param LoggerInterface $logger Logger */ public function __construct( FeedServiceV2 $feedService, ItemServiceV2 $itemService, - IURLGenerator $url, + IURLGenerator $urlGenerator, IL10N $l, LoggerInterface $logger ) { - $this->itemService = $itemService; - $this->feedService = $feedService; - $this->url = $url; - $this->l = $l; - $this->logger = $logger; + $this->itemService = $itemService; + $this->feedService = $feedService; + $this->urlGenerator = $urlGenerator; + $this->l = $l; + $this->logger = $logger; } /** @@ -107,7 +107,7 @@ class ShareService $sharedItem->setSharedBy($userId); // Get 'shared with me' dummy feed - $feedUrl = $this->url->getBaseUrl() . '/news/sharedwithme'; + $feedUrl = $this->urlGenerator->getBaseUrl() . '/news/sharedwithme'; $feed = $this->feedService->findByUrl($shareRecipientId, $feedUrl); if (is_null($feed)) { $feed = new Feed(); diff --git a/tests/Unit/Service/ShareServiceTest.php b/tests/Unit/Service/ShareServiceTest.php index d9e836a18..9dd49484d 100644 --- a/tests/Unit/Service/ShareServiceTest.php +++ b/tests/Unit/Service/ShareServiceTest.php @@ -50,7 +50,7 @@ class ShareServiceTest extends TestCase /** * @var MockObject|IURLGenerator */ - private $url; + private $urlGenerator; /** * @var MockObject|IL10N @@ -88,7 +88,7 @@ class ShareServiceTest extends TestCase ->getMockBuilder(FeedServiceV2::class) ->disableOriginalConstructor() ->getMock(); - $this->url = $this + $this->urlGenerator = $this ->getMockBuilder(IURLGenerator::class) ->disableOriginalConstructor() ->getMock(); @@ -101,7 +101,7 @@ class ShareServiceTest extends TestCase $this->class = new ShareService( $this->feedService, $this->itemService, - $this->url, + $this->urlGenerator, $this->l, $this->logger ); @@ -150,7 +150,7 @@ class ShareServiceTest extends TestCase ->with($this->uid, $itemId) ->will($this->returnValue($item)); - $this->url->expects($this->once()) + $this->urlGenerator->expects($this->once()) ->method('getBaseUrl') ->will($this->returnValue('http://serverurl')); @@ -209,7 +209,7 @@ class ShareServiceTest extends TestCase ->with($this->uid, $itemId) ->will($this->returnValue($item)); - $this->url->expects($this->once()) + $this->urlGenerator->expects($this->once()) ->method('getBaseUrl') ->will($this->returnValue('http://serverurl')); |