Пример #1
0
	/**
	 * Tests the JLoader::loadByNamespaceNaturalCase method
	 * with a camel case namespace and camel case path.
	 *
	 * @return  void
	 *
	 * @since   12.3
	 * @covers  JLoader::loadByNamespaceNaturalCase
	 */
	public function testLoadByNamespaceNaturalCaseCamelCase()
	{
		// Register the Color namespace and its path (camel case).
		$path = dirname(__FILE__) . '/stubs/Color';
		JLoader::registerNamespace('Color', $path);

		// Register a second path for that namespace (camel case).
		$path = dirname(__FILE__) . '/stubs/Color2';
		JLoader::registerNamespace('Color', $path);

		// Check we can load a class from the first path.
		$this->assertTrue(JLoader::loadByNamespaceNaturalCase('Color\\Rgb\\Red'));

		// Check we can load a class from the second path.
		$this->assertTrue(JLoader::loadByNamespaceNaturalCase('Color\\Blue'));
	}