Skip to content
Snippets Groups Projects
Commit 800db3be authored by Patrick Barroca's avatar Patrick Barroca
Browse files

rel #17990 : fix tests fixture to reflect real usage case

parent 29edd3aa
Branches
Tags
2 merge requests!565Dev#17990 miop integration suite,!561Dev#17990 miop integration suite
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class CompositeBuilderTreeTest extends CompositeBuilderTreeTestCase {
......@@ -25,7 +25,7 @@ class CompositeBuilderTreeTest extends CompositeBuilderTreeTestCase {
}
public function testFeteInternetIsInEvenements() {
$this->assertTrue(in_array($this->fete_internet,
$this->assertTrue(in_array($this->fete_internet,
$this->evenements->getItems()));
}
......@@ -33,7 +33,7 @@ class CompositeBuilderTreeTest extends CompositeBuilderTreeTestCase {
$this->assertEquals(4, $this->visite_bib->getId());
}
public function testAnimationSubcategories() {
public function testAnimationSubcategories() {
$this->assertEquals(array($this->animation_jeunesse, $this->animation_adulte),
$this->animation->getCategories());
}
......@@ -77,7 +77,4 @@ class ItemVisitorTest extends CompositeBuilderTreeTestCase {
$this->root->acceptVisitor($this);
$this->assertEquals($this->expected_visit, $this->actual_visit);
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
abstract class CompositeBuilderTreeTestCase extends PHPUnit_Framework_TestCase {
public function setUp() {
......@@ -34,11 +34,18 @@ abstract class CompositeBuilderTreeTestCase extends PHPUnit_Framework_TestCase {
- fete internet 5
*/
$builder = new CompositeBuilder("ItemCategory", "BaseItem");
$this->root = $builder->getRoot();
$this->animation = $builder->newSubcategoryIn(1, 0);
$this->animation_jeunesse = $builder->newSubcategoryIn(11, 1);
$this->animation_adulte = $builder->newSubcategoryIn(12, 1);
$this->evenements = $builder->newSubCategoryIn(2, 0);
$this->root = $builder
->getRoot()
->addCategoriesFromRows([$this->def(1, 0),
$this->def(11, 1),
$this->def(12, 1),
$this->def(2, 0)],
'id', 'pid');
$this->animation = $this->root->getCategoryWithId(1);
$this->animation_jeunesse = $this->animation->getCategoryWithId(11);
$this->animation_adulte = $this->animation->getCategoryWithId(12);
$this->evenements = $this->root->getCategoryWithId(2);
$this->rencontre_pere_noel = $builder->newItemIn(2, 11);
$this->carnaval = $builder->newItemIn(3, 11);
......@@ -48,5 +55,10 @@ abstract class CompositeBuilderTreeTestCase extends PHPUnit_Framework_TestCase {
$this->categorie_fantome = $builder->newSubcategoryIn(99, 99);
$this->article_fantome = $builder->newItemIn(99, 99);
}
protected function def($id, $pid) {
return ['id' => $id, 'pid' => $pid];
}
}
?>
\ No newline at end of file
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