@@ 300-321 (lines=22) @@ | ||
297 | $socialBarExt->getGooglePlusButton(array(), 'invalid'); |
|
298 | } |
|
299 | ||
300 | public function testGetLinkedInButton_follow() |
|
301 | { |
|
302 | $containerMock = $this->getMockBuilder("Symfony\Component\DependencyInjection\ContainerInterface")->getMock(); |
|
303 | $helperMock = $this->getMockBuilder("Azine\SocialBarBundle\Templating\SocialBarHelper")->disableOriginalConstructor()->getMock(); |
|
304 | ||
305 | $action = 'follow'; |
|
306 | $inputRenderingParams = array(); |
|
307 | $companyId = '6543234567'; |
|
308 | $expectedRenderingParams = array('locale' => 'en', |
|
309 | 'companyId' => $companyId, |
|
310 | 'action' => 'IN/FollowCompany', |
|
311 | 'counterLocation' => 'right', |
|
312 | ); |
|
313 | ||
314 | $helperMock->expects($this->once())->method('linkedInButton')->with($expectedRenderingParams); |
|
315 | $containerMock->expects($this->once())->method('get')->with('azine.socialBarHelper', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)->will($this->returnValue($helperMock)); |
|
316 | $containerMock->expects($this->once())->method('getParameter')->with('azine_social_bar_linked_in_company_id')->will($this->returnValue($companyId)); |
|
317 | ||
318 | $socialBarExt = new SocialBarTwigExtension($containerMock); |
|
319 | $socialBarExt->getLinkedInButton($inputRenderingParams, $action); |
|
320 | } |
|
321 | ||
322 | public function testGetLinkedInButton_share() |
|
323 | { |
|
324 | $containerMock = $this->getMockBuilder("Symfony\Component\DependencyInjection\ContainerInterface")->getMock(); |
|
@@ 354-375 (lines=22) @@ | ||
351 | $socialBarExt->getLinkedInButton(array(), 'invalid'); |
|
352 | } |
|
353 | ||
354 | public function testGetXingButton_follow() |
|
355 | { |
|
356 | $containerMock = $this->getMockBuilder("Symfony\Component\DependencyInjection\ContainerInterface")->getMock(); |
|
357 | $helperMock = $this->getMockBuilder("Azine\SocialBarBundle\Templating\SocialBarHelper")->disableOriginalConstructor()->getMock(); |
|
358 | ||
359 | $action = 'follow'; |
|
360 | $inputRenderingParams = array(); |
|
361 | $profileUrl = 'http://xing.com/some/profile/url/76543234567'; |
|
362 | $expectedRenderingParams = array('locale' => 'en', |
|
363 | 'url' => $profileUrl, |
|
364 | 'action' => 'XING/Share', |
|
365 | 'counterLocation' => 'right', |
|
366 | ); |
|
367 | ||
368 | $helperMock->expects($this->once())->method('xingButton')->with($expectedRenderingParams); |
|
369 | $containerMock->expects($this->once())->method('get')->with('azine.socialBarHelper', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)->will($this->returnValue($helperMock)); |
|
370 | $containerMock->expects($this->once())->method('getParameter')->with('azine_social_bar_xing_profile_url')->will($this->returnValue($profileUrl)); |
|
371 | ||
372 | $socialBarExt = new SocialBarTwigExtension($containerMock); |
|
373 | $socialBarExt->getXingButton($inputRenderingParams, $action); |
|
374 | } |
|
375 | ||
376 | public function testGetXingButton_share() |
|
377 | { |
|
378 | $containerMock = $this->getMockBuilder("Symfony\Component\DependencyInjection\ContainerInterface")->getMock(); |