Skip to content
Snippets Groups Projects
Commit 834498b3 authored by llaffont's avatar llaffont
Browse files

Correction tests

parent 3faa9657
No related merge requests found
......@@ -602,16 +602,28 @@ class PanierControllerAjoutAjaxNotLoggedTest extends PanierControllerTestCase {
class PanierControllerAjoutAjaxLoggedManonWithoutPanierTest extends PanierControllerTestCase {
protected $_xpath, $_response;
public function setUp() {
parent::setUp();
$this->manon->setPaniers([]);
$this->dispatch('/panier/ajout-ajax/id_notice/133', true);
$this->_xpath = new Storm_Test_XPath();
$this->_response = json_decode($this->_response->getBody());
}
/** @test */
public function shouldContainOnlyNouveauPanier() {
$this->assertXPathContentContains('//option', 'nouveau panier');
$this->assertXPathCount('//option', 1);
public function optionShouldContainsNouveauPanier() {
$this->_xpath->assertXPathContentContains($this->_response->content, '//option', 'nouveau panier');
}
/** @test */
public function thereShouldBeOnlyOneOption() {
$this->_xpath->assertXPathCount($this->_response->content, '//option', 1);
}
}
......@@ -619,17 +631,32 @@ class PanierControllerAjoutAjaxLoggedManonWithoutPanierTest extends PanierContro
class PanierControllerAjoutAjaxLoggedManonWithPanierTest extends PanierControllerTestCase {
protected $_xpath, $_response;
public function setUp() {
parent::setUp();
$this->manon->setPaniers([Class_PanierNotice::newInstanceWithId(12, ['libelle' => 'Terminator'])]);
$this->dispatch('/panier/ajout-ajax/id_notice/133');
$this->dispatch('/panier/ajout-ajax/id_notice/133', true);
$this->_xpath = new Storm_Test_XPath();
$this->_response = json_decode($this->_response->getBody());
}
/** @test */
public function shouldContainExpectedPaniers() {
$this->assertXPathContentContains('//option', 'nouveau panier');
$this->assertXPathContentContains('//option[@value="12"]', 'Terminator');
$this->assertXPathCount('//option', 2);
public function optionsShouldContainNouveauPanier() {
$this->_xpath->assertXPathContentContains($this->_response->content, '//option', 'nouveau panier');
}
/** @test */
public function optionValue12ShouldContainsTerminator() {
$this->_xpath->assertXPathContentContains($this->_response->content, '//option[@value="12"]', 'Terminator');
}
/** @test */
public function thereShouldBeTwoOptions() {
$this->_xpath->assertXPathCount($this->_response->content, '//option', 2);
}
}
......
......@@ -111,6 +111,8 @@ class ZendAfi_View_Helper_Notice_MurForArticleTest extends ZendAfi_View_Helper_N
}
class ZendAfi_View_Helper_Notice_Mur_BarreDeLienTest extends ZendAfi_View_Helper_Notice_MurTestCase {
public function setUp() {
parent::setUp();
......
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