/**
  * the singleton pattern
  *
  * @return Projects_Controller_Project
  */
 public static function getInstance()
 {
     if (self::$_instance === NULL) {
         self::$_instance = new Projects_Controller_Project();
     }
     return self::$_instance;
 }
Пример #2
0
 /**
  * try to add a Project
  *
  */
 public function testAddProject()
 {
     $project = $this->_getProjectData();
     $projectData = $this->_json->saveProject($project);
     // checks
     $this->assertEquals($project['description'], $projectData['description']);
     $this->assertEquals(Tinebase_Core::getUser()->getId(), $projectData['created_by'], 'Created by has not been set.');
     // cleanup
     $this->_json->deleteProjects($projectData['id']);
     // check if it got deleted
     $this->setExpectedException('Tinebase_Exception_NotFound');
     Projects_Controller_Project::getInstance()->get($projectData['id']);
 }
 /**
  * the constructor
  *
  */
 public function __construct()
 {
     $this->_applicationName = 'Projects';
     $this->_controller = Projects_Controller_Project::getInstance();
 }