/** * @testdox Ensure the addViewPath() correctly adds a path when initialising views * * @covers JControllerLegacy::addViewPath * @note addPath call JPath::check which will exit if the path is out of bounds. * If execution halts for some reason, a bad path could be the culprit. */ public function testAddViewPath() { $this->class->addViewPath(JPATH_ROOT . '/views'); $paths = TestReflection::getValue($this->class, 'paths'); $this->assertTrue(is_array($paths['view']), 'The path type should be an array.'); $this->assertEquals(str_replace(DIRECTORY_SEPARATOR, '/', $paths['view'][0]), str_replace(DIRECTORY_SEPARATOR, '/', JPATH_ROOT . '/views/'), 'Line:' . __LINE__ . ' The path type should be present, clean and with a trailing slash.'); }