Esempio n. 1
0
 protected function Initialise()
 {
     parent::Initialise();
     $login = new ValidateLoginUrlHandler(new UnitTestingLoginProvider(), "/login/index");
     $login->SetPriority(20);
     $this->AddUrlHandlers(["/cant/be/here" => $login]);
     $login = new ValidateLoginUrlHandler(new UnitTestingLoginProvider(), "/defo/not/here/login/index/", ["login/index/" => new ClassMappedUrlHandler("\\Rhubarb\\Crown\\Tests\\Fixtures\\SimpleContent")]);
     $login->SetPriority(20);
     $this->AddUrlHandlers(["/defo/not/here/" => $login]);
     $this->AddUrlHandlers(["/" => new ClassMappedUrlHandler("\\Rhubarb\\Crown\\Tests\\Fixtures\\SimpleContent", ["nmh/" => new NamespaceMappedUrlHandler("Rhubarb\\Crown\\Tests\\UrlHandlers\\Fixtures\\NamespaceMappedHandlerTests"), "simple/" => new ClassMappedUrlHandler("\\Rhubarb\\Crown\\Tests\\Fixtures\\SimpleContent"), "files/" => new StaticResourceUrlHandler(__DIR__ . "/UrlHandlers/Fixtures/")])]);
     /*
     $this->AddUrlHandlers(
         [
             "/" => new NamespaceMappedUrlHandler("Rhubarb\Leaf\Presenters",
                 [
                     "nmh/" => new NamespaceMappedUrlHandler("Rhubarb\Crown\Tests\NamespaceMappedHandlerTests"),
                     "files/" => new StaticResourceUrlHandler(__DIR__ . "/UrlHandlers/Fixtures/")
                 ])
         ]);
     */
     $this->AddUrlHandlers("/priority-test/", new ValidateLoginUrlHandler(new UnitTestingLoginProvider(), "/login/index"));
     $test = new NamespaceMappedUrlHandler("Rhubarb\\Leaf\\Presenters");
     $test->SetPriority(100);
     $this->AddUrlHandlers("/priority-test/", $test);
     EmailProvider::setDefaultEmailProviderClassName('\\Rhubarb\\Crown\\Tests\\Fixtures\\UnitTestingEmailProvider');
 }
Esempio n. 2
0
 protected function initialise()
 {
     require_once __DIR__ . '/../../unit/UrlHandlers/UrlHandlerTestUnitTest.php';
     parent::initialise();
     $login = new ValidateLoginUrlHandler(UnitTestingLoginProvider::singleton(), "/login/index");
     $login->SetPriority(20);
     $this->addUrlHandlers(["/cant/be/here" => $login]);
     $login = new ValidateLoginUrlHandler(UnitTestingLoginProvider::singleton(), "/defo/not/here/login/index/", ["login/index/" => new ClassMappedUrlHandler(SimpleContent::class)]);
     $login->setPriority(20);
     $this->addUrlHandlers(["/defo/not/here/" => $login]);
     $this->addUrlHandlers([new UnitTestComputedUrlHandler()]);
     $this->addUrlHandlers(["/" => new ClassMappedUrlHandler(SimpleContent::class, ["nmh/" => new NamespaceMappedUrlHandler('Rhubarb\\Crown\\Tests\\Fixtures\\UrlHandlers\\NamespaceMappedHandlerTests'), "simple/" => new ClassMappedUrlHandler(SimpleContent::class), "files/" => new StaticResourceUrlHandler(__DIR__ . "/../UrlHandlers/")])]);
     $this->addUrlHandlers("/priority-test/", new ValidateLoginUrlHandler(UnitTestingLoginProvider::singleton(), "/login/index"));
     $test = new NamespaceMappedUrlHandler('Rhubarb\\Leaf\\Presenters');
     $test->setPriority(100);
     $this->addUrlHandlers("/priority-test/", $test);
     EmailProvider::setProviderClassName(UnitTestingEmailProvider::class);
 }