/** * Tests the getPath method. * * @return void * * @covers Joomla\View\AbstractHtmlView::getPath * @since 1.0 */ public function testGetPath() { // Set up a priority queue. $paths = $this->instance->getPaths(); $paths->insert(__DIR__ . '/layouts1', 1); $paths->insert(__DIR__ . '/layouts2', 2); // Use of realpath to ensure test works for on all platforms $this->assertEquals(realpath(__DIR__ . '/layouts2/olivia.php'), $this->instance->getPath('olivia')); $this->assertEquals(realpath(__DIR__ . '/layouts1/peter.php'), $this->instance->getPath('peter')); $this->assertEquals(realpath(__DIR__ . '/layouts2/fauxlivia.php'), $this->instance->getPath('fauxlivia')); $this->assertEquals(realpath(__DIR__ . '/layouts1/fringe/division.php'), $this->instance->getPath('fringe/division')); $this->assertEquals(realpath(__DIR__ . '/layouts1/astrid.phtml'), $this->instance->getPath('astrid', 'phtml')); $this->assertFalse($this->instance->getPath('walter')); // Check dirty path. $this->assertEquals(realpath(__DIR__ . '/layouts1/fringe/division.php'), $this->instance->getPath('fringe//\\division')); }