AuxiliaryTest.php in Autoload 7
File
src/Tests/Unit/AuxiliaryTest.php
View source
<?php
namespace Drupal\autoload\Tests\Unit;
class AuxiliaryTest extends \DrupalWebTestCase {
protected static $modules = array(
'autoload',
);
public static function getInfo() {
return array(
'name' => 'Auxiliary',
'group' => 'Autoload',
'description' => t('Testing various auxiliary functions.'),
);
}
protected function setUp() {
parent::setUp(static::$modules);
}
public function test() {
$this
->assertEqual(autoload_namespace_to_path('One\\Two/Three'), 'One/Two/Three');
$this
->assertEqual(autoload_path_to_namespace('One/Two\\Three'), 'One\\Two\\Three');
}
protected function assertClasses($namespace, array $classes) {
$classes = array_combine($classes, $classes);
$this
->assertEqual($classes, array_intersect_key(autoload_seek_classes($namespace), $classes), 'Required classes found.');
}
protected function assertExtensions(array $extensions) {
$this
->assertFalse(array_diff(autoload_extensions(), $extensions), 'Required extensions available.');
}
}