Example #1
0
 public static function create()
 {
     if (self::$instance === null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Example #2
0
 public function setUp()
 {
     $this->bus = new Sabel_Bus();
     $this->bus->set("session", Sabel_Session_InMemory::create());
     $this->bus->setConfig("map", new TestMapConfig());
     $this->bus->setConfig("addon", new TestAddonConfig());
 }
Example #3
0
 protected function request(Sabel_Request $request, $session = null, $maxRedirects = 0)
 {
     if ($session === null) {
         $session = Sabel_Session_InMemory::create();
     }
     Sabel_Cookie_Factory::create()->set($session->getName(), $session->getId());
     if ($maxRedirects > 0) {
         return $this->requestWithRedirect($request, $session, $maxRedirects);
     } else {
         $bus = new Sabel_Bus();
         $bus->set("request", $request);
         $bus->set("session", $session);
         $bus->run(new Config_Bus());
         return $bus->get("response");
     }
 }
Example #4
0
 protected function getBus($uri)
 {
     $bus = new Sabel_Bus();
     $bus->set("request", new Sabel_Request_Object($uri));
     $bus->set("session", Sabel_Session_InMemory::create());
     return $bus;
 }