File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
tests/bitExpert/PHPStan/Magento/Autoload Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace bitExpert \PHPStan \Magento \Autoload ;
4+
5+ use PHPStan \Cache \Cache ;
6+ use PHPUnit \Framework \TestCase ;
7+
8+ class RegistrationUnitTest extends TestCase
9+ {
10+ /**
11+ * @test
12+ * @dataProvider provideAutoloaders()
13+ */
14+ public function autoloadersCanRegisterAndUnregister (Autoloader $ autoloader )
15+ {
16+ $ autoloadFunctions = spl_autoload_functions ();
17+ $ autoloader ->register ();
18+ static ::assertCount (count ($ autoloadFunctions ) + 1 , spl_autoload_functions ());
19+ $ autoloader ->unregister ();
20+ static ::assertCount (count ($ autoloadFunctions ), spl_autoload_functions ());
21+ }
22+
23+ public function provideAutoloaders (): array
24+ {
25+ $ cache = new Cache ($ this ->getMockBuilder (\PHPStan \Cache \CacheStorage::class)->getMock ());
26+
27+ return [
28+ [new FactoryAutoloader ($ cache )],
29+ [new MockAutoloader ()],
30+ [new ProxyAutoloader ($ cache )],
31+ [new TestFrameworkAutoloader ()]
32+ ];
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments