-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoload.php
70 lines (48 loc) · 1.38 KB
/
Autoload.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
declare(strict_types=1);
/*
* This file is part of the QuidPHP package <https://quidphp.com>
* Author: Pierre-Philippe Emond <emondpph@gmail.com>
* License: https://github.com/quidphp/base/blob/master/LICENSE
*/
namespace Quid\Test\Base;
use Quid\Base;
// autoload
// class for testing Quid\Base\Autoload
class Autoload extends Base\Test
{
// trigger
final public static function trigger(array $data):bool
{
// call
// getExtensions
assert(Base\Autoload::getExtensions() === '.inc,.php');
// setExtensions
// register
// unregister
// unregisterAll
// all
assert(count(Base\Autoload::all()) >= 3);
// index
assert(is_callable(Base\Autoload::index(0)));
// getPath
// getFilePath
// getDirPath
// getPsr4
assert(Base\Autoload::getPsr4('Appz') === null);
// setPsr4
Base\Autoload::setPsr4('Appz','test');
// setsPsr4
// unsetPsr4
assert(Base\Autoload::getPsr4('Appz') === ['Appz'=>'test']);
Base\Autoload::unsetPsr4('Appz');
// allPsr4
assert(!empty(Base\Autoload::allPsr4()));
// removeAlias
assert(count(Base\Autoload::removeAlias([static::class,'jamesAlias','row\rowalias'])) === 2);
// overview
// phpExtension
return true;
}
}
?>