예제 #1
0
 /**
  * Test delete
  */
 public function testDelete()
 {
     $project = new Project_Models_Project();
     $project->find(1);
     $project->delete();
     $search = new Phprojekt_Search();
     $result = (array) $search->search('Karlsruhe');
     $this->assertEquals(0, count($result));
 }
예제 #2
0
 /**
  * Search for words.
  *
  * Returns a list of items that have the word, sorted by module with:
  * <pre>
  *  - id            => id of the item found.
  *  - moduleId      => id of the module.
  *  - moduleName    => Name of the module.
  *  - moduleLabel   => Display for the module.
  *  - firstDisplay  => Firts display for the item (Ej. title).
  *  - secondDisplay => Second display for the item (Ej. notes).
  *  - projectId     => Parent project id of the item.
  * </pre>
  *
  * REQUIRES request parameters:
  * <pre>
  *  - string <b>words</b> An string of words (Will be separated by the spaces).
  * </pre>
  *
  * OPTIONAL request parameters:
  * <pre>
  *  - integer <b>count</b> Number of results.
  * </pre>
  *
  * The return is in JSON format.
  *
  * @return void
  */
 public function jsonSearchAction()
 {
     $words = (string) $this->getRequest()->getParam('words');
     $count = (int) $this->getRequest()->getParam('count', null);
     $offset = (int) $this->getRequest()->getParam('start', null);
     $search = new Phprojekt_Search();
     $tags = new Phprojekt_Tags();
     $searchresults = $search->search($words, $count);
     $tagresults = $tags->search($words, $count);
     $results = array('search' => $searchresults, 'tags' => $tagresults);
     Phprojekt_Converter_Json::echoConvert($results);
 }
예제 #3
0
 /**
  * Test delete
  */
 public function testDelete()
 {
     $project = new Project_Models_Project();
     $project->find(Zend_Registry::get('searchInsertedId'));
     $project->delete();
     $search = new Phprojekt_Search();
     $result = (array) $search->search('CCÄC DDÖD');
     $this->assertEquals(0, count($result));
 }