Esempio n. 1
0
 /**
  * @covers FOS\FacebookBundle\Templating\Helper\FacebookHelper::loginButton
  */
 public function testLoginButton()
 {
     $expected = new \stdClass();
     $templating = $this->getMockBuilder('Symfony\\Component\\Templating\\DelegatingEngine')->disableOriginalConstructor()->getMock();
     $templating->expects($this->once())->method('render')->with('FOSFacebookBundle::loginButton.html.php', array('autologoutlink' => 'false', 'label' => 'testLabel', 'scope' => '1,2,3'))->will($this->returnValue($expected));
     $facebookMock = $this->getMock('\\BaseFacebook', array('getAppId'));
     $facebookMock->expects($this->any())->method('getAppId');
     $helper = new FacebookHelper($templating, $facebookMock, true, 'en_US', array(1, 2, 3));
     $this->assertSame($expected, $helper->loginButton(array('label' => 'testLabel')));
 }
 /**
  * @covers FOS\FacebookBundle\Templating\Helper\FacebookHelper::loginButton
  */
 public function testLoginButton()
 {
     $expected = new \stdClass();
     $templating = $this->getMockBuilder('Symfony\\Component\\Templating\\DelegatingEngine')->disableOriginalConstructor()->getMock();
     $templating->expects($this->once())->method('render')->with('FOSFacebookBundle::loginButton.html.php', array('autologoutlink' => 'false', 'label' => 'testLabel', 'showFaces' => 'false', 'width' => '', 'maxRows' => '1', 'scope' => '1,2,3', 'registrationUrl' => '', 'size' => 'medium', 'onlogin' => ''))->will($this->returnValue($expected));
     $facebookMock = $this->getMockBuilder('FOS\\FacebookBundle\\Facebook\\FacebookSessionPersistence')->disableOriginalConstructor()->setMethods(array('getAppId'))->getMock();
     $routing = $this->getMockBuilder('Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface')->disableOriginalConstructor()->getMock();
     $facebookMock->expects($this->any())->method('getAppId');
     $helper = new FacebookHelper($templating, $facebookMock, $routing, true, 'en_US', array(1, 2, 3));
     $this->assertSame($expected, $helper->loginButton(array('label' => 'testLabel')));
 }