Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3942667
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/tests/Registration/AutoloaderTest.php b/tests/Registration/AutoloaderTest.php
index a8ee921..520e430 100644
--- a/tests/Registration/AutoloaderTest.php
+++ b/tests/Registration/AutoloaderTest.php
@@ -1,42 +1,44 @@
<?php
declare(strict_types=1);
namespace Keruald\OmniTools\Tests\Registration;
use Keruald\OmniTools\Registration\Autoloader;
use Keruald\OmniTools\Tests\WithData;
use PHPUnit\Framework\TestCase;
use Acme\MockLib\Foo; // a mock class in a mock namespace to test autoload.
class AutoloaderTest extends TestCase {
use WithData;
public function testRegisterPSR4 () : void {
$class = Foo::class;
$this->assertFalse(
class_exists($class),
"Please reconfigure the test suite not to include the $class class."
);
Autoloader::registerPSR4("Acme\\MockLib\\", $this->getDataPath("MockLib"));
$this->assertTrue(class_exists($class));
+
+ $this->assertFalse(class_exists("NotExisting"));
}
public function testGetLibraryPath () : void {
$this->assertStringStartsWith(
dirname(Autoloader::getLibraryPath()), // lib is in <root>/src
__DIR__ // we are in <root>/tests/…
);
}
public function testRegister () : void {
$count = count(spl_autoload_functions());
Autoloader::selfRegister();
$this->assertEquals(++$count, count(spl_autoload_functions()));
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Dec 26, 19:57 (11 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2315300
Default Alt Text
(1 KB)
Attached To
Mode
rKOT Keruald OmniTools
Attached
Detach File
Event Timeline
Log In to Comment