@@ 309-330 (lines=22) @@ | ||
306 | ||
307 | } |
|
308 | ||
309 | public function testGetLinkedInButton_follow() |
|
310 | { |
|
311 | $containerMock = $this->getMockBuilder("Symfony\Component\DependencyInjection\ContainerInterface")->getMock(); |
|
312 | $helperMock = $this->getMockBuilder("Azine\SocialBarBundle\Templating\SocialBarHelper")->disableOriginalConstructor()->getMock(); |
|
313 | ||
314 | $action = 'follow'; |
|
315 | $inputRenderingParams = array(); |
|
316 | $companyId = "6543234567"; |
|
317 | $expectedRenderingParams = array( 'locale' => 'en', |
|
318 | 'companyId' => $companyId, |
|
319 | 'action' => 'IN/FollowCompany', |
|
320 | 'counterLocation' => 'right', |
|
321 | ); |
|
322 | ||
323 | $helperMock->expects($this->once())->method("linkedInButton")->with($expectedRenderingParams); |
|
324 | $containerMock->expects($this->once())->method("get")->with('azine.socialBarHelper', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)->will($this->returnValue($helperMock)); |
|
325 | $containerMock->expects($this->once())->method("getParameter")->with("azine_social_bar_linked_in_company_id")->will($this->returnValue($companyId)); |
|
326 | ||
327 | $socialBarExt = new SocialBarTwigExtension($containerMock); |
|
328 | $socialBarExt->getLinkedInButton($inputRenderingParams, $action); |
|
329 | ||
330 | } |
|
331 | ||
332 | public function testGetLinkedInButton_share() |
|
333 | { |
|
@@ 366-387 (lines=22) @@ | ||
363 | ||
364 | } |
|
365 | ||
366 | public function testGetXingButton_follow() |
|
367 | { |
|
368 | $containerMock = $this->getMockBuilder("Symfony\Component\DependencyInjection\ContainerInterface")->getMock(); |
|
369 | $helperMock = $this->getMockBuilder("Azine\SocialBarBundle\Templating\SocialBarHelper")->disableOriginalConstructor()->getMock(); |
|
370 | ||
371 | $action = 'follow'; |
|
372 | $inputRenderingParams = array(); |
|
373 | $profileUrl = "http://xing.com/some/profile/url/76543234567"; |
|
374 | $expectedRenderingParams = array( 'locale' => 'en', |
|
375 | 'url' => $profileUrl, |
|
376 | 'action' => 'XING/Share', |
|
377 | 'counterLocation' => 'right', |
|
378 | ); |
|
379 | ||
380 | $helperMock->expects($this->once())->method("xingButton")->with($expectedRenderingParams); |
|
381 | $containerMock->expects($this->once())->method("get")->with('azine.socialBarHelper', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)->will($this->returnValue($helperMock)); |
|
382 | $containerMock->expects($this->once())->method("getParameter")->with("azine_social_bar_xing_profile_url")->will($this->returnValue($profileUrl)); |
|
383 | ||
384 | $socialBarExt = new SocialBarTwigExtension($containerMock); |
|
385 | $socialBarExt->getXingButton($inputRenderingParams, $action); |
|
386 | ||
387 | } |
|
388 | ||
389 | public function testGetXingButton_share() |
|
390 | { |