public function ExtensionsTest::test in Autoload 7
Same name and namespace in other branches
- 7.2 src/Tests/Unit/ExtensionsTest.php \Drupal\autoload\Tests\Unit\ExtensionsTest::test()
Unit tests for auxiliary functions.
Overrides AuxiliaryTest::test
File
- src/
Tests/ Unit/ ExtensionsTest.php, line 29
Class
- ExtensionsTest
- Class ExtensionsTest.
Namespace
Drupal\autoload\Tests\UnitCode
public function test() {
// These extensions are always available!
$this
->assertExtensions(array(
'.php',
'.inc',
));
// Only Drupal can change this. Modules cannot!
spl_autoload_extensions('.test');
// List of extensions changed as expected.
$this
->assertExtensions(array(
'.php',
'.inc',
'.test',
));
// But class must not exist since extension was registered not by Drupal.
$this
->assertFalse(class_exists('Drupal\\autoload_test_extensions\\PSR4'));
}