public static function create() { if (self::$instance === null) { self::$instance = new self(); } return self::$instance; }
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()); }
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"); } }
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; }