class ExtensionsTest in Autoload 7
Same name and namespace in other branches
- 7.2 src/Tests/Unit/ExtensionsTest.php \Drupal\autoload\Tests\Unit\ExtensionsTest
Class ExtensionsTest.
Hierarchy
- class \Drupal\autoload\Tests\Unit\AuxiliaryTest extends \Drupal\autoload\Tests\Unit\DrupalWebTestCase
- class \Drupal\autoload\Tests\Unit\ExtensionsTest
Expanded class hierarchy of ExtensionsTest
File
- src/
Tests/ Unit/ ExtensionsTest.php, line 8
Namespace
Drupal\autoload\Tests\UnitView source
class ExtensionsTest extends AuxiliaryTest {
/**
* {@inheritdoc}
*/
protected static $modules = array(
'autoload_test_extensions',
);
/**
* {@inheritdoc}
*/
public static function getInfo() {
$info = parent::getInfo();
$info['name'] = 'Extensions';
$info['description'] = t('Ensure that registered file extensions available for autoloading.');
return $info;
}
/**
* {@inheritdoc}
*/
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'));
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AuxiliaryTest:: |
protected | function | Assert sought classes. | |
AuxiliaryTest:: |
protected | function | Assert registered extensions for autoloading. | |
AuxiliaryTest:: |
protected | function | ||
ExtensionsTest:: |
protected static | property |
Modules which should enabled for testing. Overrides AuxiliaryTest:: |
|
ExtensionsTest:: |
public static | function |
Overrides AuxiliaryTest:: |
|
ExtensionsTest:: |
public | function |
Unit tests for auxiliary functions. Overrides AuxiliaryTest:: |