N98\Util\AutoloadHandlerTest::noRegistrationOnCreation PHP Метод

noRegistrationOnCreation() публичный Метод

    public function noRegistrationOnCreation()
    {
        $handler = $this->create(null, AutoloadHandler::NO_AUTO_REGISTER);
        $handler->disable();
        // assertions require a disabled handler b/c of exceptions
        $this->assertFalse(in_array($handler, spl_autoload_functions()));
        $this->assertFalse($handler->__invoke('test'));
        $handler->register();
        $actual = in_array($handler, spl_autoload_functions());
        $this->assertTrue($actual);
        $handler->enable();
        $handler->__invoke('test');
        $this->fail('An expected exception was not thrown');
    }