Skip to content
Snippets Groups Projects
Commit 18abc265 authored by llaffont's avatar llaffont
Browse files

Les liens vers les formations tout apprendre s'ouvrent dans un autre onglet

parent fb788d07
Branches
Tags
No related merge requests found
......@@ -33,9 +33,14 @@ class ZendAfi_View_Helper_TagCoursToutApprendre extends ZendAfi_View_Helper_TagR
foreach ($album->getRessources() as $ressource) {
$toutapprendre= Class_ToutApprendreLink::forRessourceAndUser($ressource, $current_user);
$html.= '<a href="'.$toutapprendre->url().'">'.$ressource->getTitre().'.</a><br/>';
$html.= '<li>'
.$this->view->tagAnchor($toutapprendre->url(),
$ressource->getTitre(),
['title' => $ressource->getTitre(),
'target' => '_blank'])
.'</li>';
}
return $html;
return '<ul>'.$html.'</ul>';
}
......
......@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once('ViewHelperTestCase.php');
class ZendAfi_View_Helper_TagCoursToutApprendreTest extends ViewHelperTestCase {
/** @var ZendAfi_View_Helper_TagCoursToutApprendre */
protected $_helper;
......@@ -88,8 +90,8 @@ class ZendAfi_View_Helper_TagCoursToutApprendreTest extends ViewHelperTestCase {
->beAbonneSIGB();
$this->assertXPathContentContains($this->_helper->tagCoursToutApprendre($this->_album),
'//a[contains(@href, "&pkl=891")]',
'psychologie sociale.');
'//a[contains(@href, "&pkl=891")][@target="_blank"]',
'psychologie sociale');
}
......@@ -103,9 +105,8 @@ class ZendAfi_View_Helper_TagCoursToutApprendreTest extends ViewHelperTestCase {
->setDateFin('2003-09-12')
->beAbonneSIGB();
$this->assertNotXPathContentContains($this->_helper->tagCoursToutApprendre($this->_album),
'//a[contains(@href, "&pkl=891")]',
'psychologie sociale.');
$this->assertNotXPath($this->_helper->tagCoursToutApprendre($this->_album),
'//a[contains(@href, "&pkl=891")]');
}
......@@ -116,9 +117,9 @@ class ZendAfi_View_Helper_TagCoursToutApprendreTest extends ViewHelperTestCase {
$this->_normand
->setDateFin('2023-09-12')
->beAbonneSIGB();
$this->assertNotXPathContentContains($this->_helper->tagCoursToutApprendre($this->_album),
'//a[contains(@href, "&pkl=891")]',
'psychologie sociale.');
$this->assertNotXPath($this->_helper->tagCoursToutApprendre($this->_album),
'//a[contains(@href, "&pkl=891")]');
}
......@@ -126,10 +127,8 @@ class ZendAfi_View_Helper_TagCoursToutApprendreTest extends ViewHelperTestCase {
/** @test */
public function withCurrentUserNotAbonneShouldNotDisplayLinkToutApprendre() {
$this->_normand->beInvite();
$this->assertNotXPathContentContains($this->_helper->tagCoursToutApprendre($this->_album),
'//a[contains(@href, "&pkl=891")]',
'psychologie sociale.');
$this->assertNotXPath($this->_helper->tagCoursToutApprendre($this->_album),
'//a[contains(@href, "&pkl=891")]');
}
......@@ -139,7 +138,6 @@ class ZendAfi_View_Helper_TagCoursToutApprendreTest extends ViewHelperTestCase {
$this->assertXPathContentContains($this->_helper->tagCoursToutApprendre($this->_album),
'//p', 'abonnement valide');
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment