|
@@ 322-343 (lines=22) @@
|
| 319 |
|
$socialBarExt->getLinkedInButton($inputRenderingParams, $action); |
| 320 |
|
} |
| 321 |
|
|
| 322 |
|
public function testGetLinkedInButton_share() |
| 323 |
|
{ |
| 324 |
|
$containerMock = $this->getMockBuilder("Symfony\Component\DependencyInjection\ContainerInterface")->getMock(); |
| 325 |
|
$helperMock = $this->getMockBuilder("Azine\SocialBarBundle\Templating\SocialBarHelper")->disableOriginalConstructor()->getMock(); |
| 326 |
|
|
| 327 |
|
$action = 'share'; |
| 328 |
|
$someUrl = 'http://some.url.com/76543234567'; |
| 329 |
|
$inputRenderingParams = array('url' => $someUrl); |
| 330 |
|
$expectedRenderingParams = array('locale' => 'en', |
| 331 |
|
'url' => $someUrl, |
| 332 |
|
'action' => 'IN/Share', |
| 333 |
|
'counterLocation' => 'right', |
| 334 |
|
); |
| 335 |
|
|
| 336 |
|
$helperMock->expects($this->once())->method('linkedInButton')->with($expectedRenderingParams); |
| 337 |
|
$containerMock->expects($this->once())->method('get')->with('azine.socialBarHelper', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)->will($this->returnValue($helperMock)); |
| 338 |
|
$containerMock->expects($this->never())->method('getParameter'); |
| 339 |
|
|
| 340 |
|
$socialBarExt = new SocialBarTwigExtension($containerMock); |
| 341 |
|
$socialBarExt->getLinkedInButton($inputRenderingParams, $action); |
| 342 |
|
} |
| 343 |
|
|
| 344 |
|
/** |
| 345 |
|
* @expectedException \Exception |
| 346 |
|
*/ |
|
@@ 376-397 (lines=22) @@
|
| 373 |
|
$socialBarExt->getXingButton($inputRenderingParams, $action); |
| 374 |
|
} |
| 375 |
|
|
| 376 |
|
public function testGetXingButton_share() |
| 377 |
|
{ |
| 378 |
|
$containerMock = $this->getMockBuilder("Symfony\Component\DependencyInjection\ContainerInterface")->getMock(); |
| 379 |
|
$helperMock = $this->getMockBuilder("Azine\SocialBarBundle\Templating\SocialBarHelper")->disableOriginalConstructor()->getMock(); |
| 380 |
|
|
| 381 |
|
$action = 'share'; |
| 382 |
|
$someUrl = 'http://some.url.com/76543234567'; |
| 383 |
|
$inputRenderingParams = array('url' => $someUrl); |
| 384 |
|
$expectedRenderingParams = array('locale' => 'en', |
| 385 |
|
'url' => $someUrl, |
| 386 |
|
'action' => 'XING/Share', |
| 387 |
|
'counterLocation' => 'right', |
| 388 |
|
); |
| 389 |
|
|
| 390 |
|
$helperMock->expects($this->once())->method('xingButton')->with($expectedRenderingParams); |
| 391 |
|
$containerMock->expects($this->once())->method('get')->with('azine.socialBarHelper', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)->will($this->returnValue($helperMock)); |
| 392 |
|
$containerMock->expects($this->never())->method('getParameter'); |
| 393 |
|
|
| 394 |
|
$socialBarExt = new SocialBarTwigExtension($containerMock); |
| 395 |
|
$socialBarExt->getXingButton($inputRenderingParams, $action); |
| 396 |
|
} |
| 397 |
|
|
| 398 |
|
/** |
| 399 |
|
* @expectedException \Exception |
| 400 |
|
*/ |