Code Duplication    Length = 22-22 lines in 2 locations

Tests/Templating/SocialBarTwigExtensionTest.php 2 locations

@@ 332-353 (lines=22) @@
329
330
    }
331
332
    public function testGetLinkedInButton_share()
333
    {
334
        $containerMock = $this->getMockBuilder("Symfony\Component\DependencyInjection\ContainerInterface")->getMock();
335
        $helperMock = $this->getMockBuilder("Azine\SocialBarBundle\Templating\SocialBarHelper")->disableOriginalConstructor()->getMock();
336
337
        $action = 'share';
338
        $someUrl = "http://some.url.com/76543234567";
339
        $inputRenderingParams = array('url' => $someUrl);
340
        $expectedRenderingParams = array(	'locale' => 'en',
341
                                            'url' => $someUrl,
342
                                            'action' => 'IN/Share',
343
                                            'counterLocation' => 'right',
344
                                    );
345
346
        $helperMock->expects($this->once())->method("linkedInButton")->with($expectedRenderingParams);
347
        $containerMock->expects($this->once())->method("get")->with('azine.socialBarHelper', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)->will($this->returnValue($helperMock));
348
        $containerMock->expects($this->never())->method("getParameter");
349
350
        $socialBarExt = new SocialBarTwigExtension($containerMock);
351
        $socialBarExt->getLinkedInButton($inputRenderingParams, $action);
352
353
    }
354
355
    /**
356
     * @expectedException \Exception
@@ 389-410 (lines=22) @@
386
387
    }
388
389
    public function testGetXingButton_share()
390
    {
391
        $containerMock = $this->getMockBuilder("Symfony\Component\DependencyInjection\ContainerInterface")->getMock();
392
        $helperMock = $this->getMockBuilder("Azine\SocialBarBundle\Templating\SocialBarHelper")->disableOriginalConstructor()->getMock();
393
394
        $action = 'share';
395
        $someUrl = "http://some.url.com/76543234567";
396
        $inputRenderingParams = array('url' => $someUrl);
397
        $expectedRenderingParams = array(	'locale' => 'en',
398
                                            'url' => $someUrl,
399
                                            'action' => 'XING/Share',
400
                                            'counterLocation' => 'right',
401
                                    );
402
403
        $helperMock->expects($this->once())->method("xingButton")->with($expectedRenderingParams);
404
        $containerMock->expects($this->once())->method("get")->with('azine.socialBarHelper', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)->will($this->returnValue($helperMock));
405
        $containerMock->expects($this->never())->method("getParameter");
406
407
        $socialBarExt = new SocialBarTwigExtension($containerMock);
408
        $socialBarExt->getXingButton($inputRenderingParams, $action);
409
410
    }
411
412
    /**
413
     * @expectedException \Exception