kompass/plugins/pfadfinden-theme-updater/tests/autoloader.php

20 lines
452 B
PHP
Raw Normal View History

2023-12-30 14:28:21 +01:00
<?php
/**
* Try to load a Pfadfinden WordPress class.
*
* @param string $name
* @return boolean
*/
function pfadfinden_wordpress_tests_autoloader( $name )
{
if ( substr( $name, 0, 27 ) !== 'Pfadfinden\\WordPress\\Tests\\' ) {
return false;
}
$name = __DIR__ . '/' . str_replace( '\\', DIRECTORY_SEPARATOR, $name ) . '.php';
return is_file( $name ) && include( $name );
}
spl_autoload_register( 'pfadfinden_wordpress_tests_autoloader' );