mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-15 18:23:26 +03:00
[!!!][FEATURE] Removed php-di as suggested by #477
NOTE: Custom class-loader should be used to create custom integrations with frameworks like php-di. See documentation for more information. - Removed all references to php-cli from composer + code. - Added ClassLoader php-unit tests.
This commit is contained in:
30
tests/Pecee/SimpleRouter/ClassLoaderTest.php
Normal file
30
tests/Pecee/SimpleRouter/ClassLoaderTest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
require_once 'Dummy/DummyMiddleware.php';
|
||||
require_once 'Dummy/DummyController.php';
|
||||
require_once 'Dummy/ClassLoader/CustomClassLoader.php';
|
||||
|
||||
class ClassLoaderTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
|
||||
public function testCustomClassLoader()
|
||||
{
|
||||
$result = false;
|
||||
|
||||
TestRouter::setCustomClassLoader(new CustomClassLoader());
|
||||
|
||||
TestRouter::get('/', 'NonExistingClass@method3');
|
||||
TestRouter::get('/test-closure', function($status) use(&$result) {
|
||||
$result = $status;
|
||||
});
|
||||
|
||||
$classLoaderClass = TestRouter::debugOutput('/', 'get', false);
|
||||
TestRouter::debugOutput('/test-closure');
|
||||
|
||||
$this->assertEquals('method3', $classLoaderClass);
|
||||
$this->assertTrue($result);
|
||||
|
||||
TestRouter::router()->reset();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user