示例#1
0
 public function setup()
 {
     Date::_SetNow(Date::Now());
     $this->db = new FakeDatabase();
     $this->fakeServer = new FakeServer();
     $this->fakeEmailService = new FakeEmailService();
     $this->fakeConfig = new FakeConfig();
     $this->fakeConfig->SetKey(ConfigKeys::DEFAULT_TIMEZONE, 'America/Chicago');
     $this->fakeResources = new FakeResources();
     $this->fakeUser = $this->fakeServer->UserSession;
     $this->fakePluginManager = new FakePluginManager();
     $this->fileSystem = new FakeFileSystem();
     ServiceLocator::SetDatabase($this->db);
     ServiceLocator::SetServer($this->fakeServer);
     ServiceLocator::SetEmailService($this->fakeEmailService);
     ServiceLocator::SetFileSystem($this->fileSystem);
     Configuration::SetInstance($this->fakeConfig);
     Resources::SetInstance($this->fakeResources);
     PluginManager::SetInstance($this->fakePluginManager);
 }