diff --git a/tests/application/modules/opac/controllers/RechercheControllerTest.php b/tests/application/modules/opac/controllers/RechercheControllerTest.php index 6ea3758e04eb2b0513211131fede827774521725..e5af13439f919619e9386f4e5bf66aab1bee2b8c 100644 --- a/tests/application/modules/opac/controllers/RechercheControllerTest.php +++ b/tests/application/modules/opac/controllers/RechercheControllerTest.php @@ -137,41 +137,6 @@ class RechercheControllerPrintTest extends RechercheControllerNoticeTestCase { - -class RechercheControllerReseauTest extends RechercheControllerNoticeTestCase { - public function setUp() { - ZendAfi_View_Helper_ShareUrl::setDefaultWebClient(Storm_Test_ObjectWrapper::mock() - ->whenCalled('open_url') - ->answers(false)); - parent::setUp(); - $this->dispatch(sprintf('recherche/reseau/id_notice/%d/type_doc/1', - $this->notice->getId()), - true); - } - - - public function tearDown() { - parent::tearDown(); - ZendAfi_View_Helper_ShareUrl::setDefaultWebClient(null); - } - - - /** @test */ - public function getResauShouldContainsTwitterGif() { - $this->assertXPath('//img[contains(@src, "twitter.gif")]'); - } - - - /** @test */ - public function getResauShouldContainsTwitterLink() { - $this->assertContains("$.getScript('/social-network/share/id_notice/345/type_doc/1/on/twitter/url", - $this->_response->getBody()); - } -} - - - - class RechercheControllerViewNoticeBabelthequeTest extends RechercheControllerNoticeTestCase { /** @test */ public function withoutBabelthequeJSShouldNotBeLoaded() { diff --git a/tests/application/modules/opac/controllers/SocialNetworkControllerTest.php b/tests/application/modules/opac/controllers/SocialNetworkControllerTest.php index 554e4f372f0f119314c7c99d5ece853a8767b809..ed8dead0ad755d80ed7a2acf97f276f93a6f057b 100644 --- a/tests/application/modules/opac/controllers/SocialNetworkControllerTest.php +++ b/tests/application/modules/opac/controllers/SocialNetworkControllerTest.php @@ -21,37 +21,11 @@ require_once 'AbstractControllerTestCase.php'; class SocialNetworkControllerShareActionTest extends AbstractControllerTestCase { - protected $_mock_web_client; - - public function setUp() { - parent::setUp(); - $this->_mock_web_client = Storm_Test_ObjectWrapper::on(new Class_WebService_SimpleWebClient()); - ZendAfi_View_Helper_ShareUrl::setDefaultWebClient($this->_mock_web_client); - } - - - public function tearDown() { - ZendAfi_View_Helper_ShareUrl::resetDefaultWebClient(); - parent::tearDown(); - } - - - protected function _expectClientOpenUrlWithLongUrlAndAnswer($url, $answer) { - $this->_mock_web_client - ->whenCalled('open_url') - ->with(sprintf('http://is.gd/api.php?longurl=%s', urlencode($url))) - ->answers($answer) - ->beStrict(); - } - - /** @test */ public function shareOnTwitterShouldInjectShortUrlAndMessageAndCountUrl() { - $this->_expectClientOpenUrlWithLongUrlAndAnswer('http://www.institut-francais.com', - 'http://is.gd/PkdNgD'); $this->dispatch('/social-network/share/on/twitter/url/'.urlencode('http://www.institut-francais.com').'/titre/'.urlencode('Vive bucarest !').'/counturl/'.urlencode('http://www.institut-francais.com'), true); - $this->assertEquals("window.open('http://twitter.com/share?url=http%3A%2F%2Fis.gd%2FPkdNgD&text=Vive+bucarest+%21&counturl=http%3A%2F%2Fis.gd%2FPkdNgD','_blank','toolbar=0,status=0,width=800, height=410');", + $this->assertEquals("window.open('http://twitter.com/share?url=http%3A%2F%2Fwww.institut-francais.com&text=Vive+bucarest+%21&counturl=http%3A%2F%2Fwww.institut-francais.com','_blank','toolbar=0,status=0,width=800, height=410');", $this->_response->getBody()); }