/** * Test JPathway::setPathway(). * * @return void * * @since 3.1 */ public function testSetPathway() { $pathway = array(); $object1 = new stdClass(); $object1->name = 'Item1'; $object1->link = 'index.php?key=item1'; $pathway[2] = $object1; $object2 = new stdClass(); $object2->name = 'Item2'; $object2->link = 'index.php?key=item2'; $pathway[4] = $object2; $this->assertThat($this->fixture->setPathway($pathway), $this->equalTo(array())); $this->assertThat(TestReflection::getValue($this->fixture, '_pathway'), $this->equalTo(array_values($pathway))); $this->assertThat($this->fixture->setPathway(array()), $this->equalTo(array_values($pathway))); $this->assertThat(TestReflection::getValue($this->fixture, '_pathway'), $this->equalTo(array())); }
/** * Test JPathway::setItemName(). * * @return void * * @since 3.1 */ public function testSetItemName() { $pathway = array(); $object1 = new stdClass(); $object1->name = 'Item1'; $object1->link = 'index.php?key=item1'; $pathway[] = $object1; $object2 = new stdClass(); $object2->name = 'Item2'; $object2->link = 'index.php?key=item2'; $pathway[] = $object2; $this->fixture->setPathway($pathway); $this->assertTrue($this->fixture->setItemName(1, 'Item3')); $pathway[1]->name = 'Item3'; $this->assertAttributeEquals($pathway, '_pathway', $this->fixture); $this->assertFalse($this->fixture->setItemName(3, 'False')); $this->assertAttributeEquals($pathway, '_pathway', $this->fixture); }
/** * Sets the pathway for the current controller * TuiyoControllerCore::setPathway() * @return void */ public function setPathway($pathway) { JPathway::setPathway($pathway); }