/**
  * @expectedException \RuntimeException
  */
 public function testForProjectWhenProjectDoesNotExist()
 {
     PhabricatorAPI::forProject("NotFound");
 }
 /**
  * Gets an instance of the Phabricator API client class for a project.
  *
  * @param string $project The Phabricator project name
  * @return Nasqueron\Notifications\Phabricator\PhabricatorAPI
  */
 public function getForProject($project)
 {
     return PhabricatorAPI::forProject($project);
 }
Пример #3
0
 /**
  * Gets the project for a specific item, using the new ApplicationSearch.
  *
  * This is a transitional method: when every Phabricator will have been
  * migrated from info (generation 1) or query (generation 2) to search
  * (generation 3), we'll rename it to getItemProjectsPHIDs and overwrite it.
  */
 protected function getItemProjectsPHIDsThroughApplicationSearch($method, $objectPHID)
 {
     if (!$objectPHID) {
         return [];
     }
     $api = PhabricatorAPI::forProject($this->instanceName);
     $reply = $api->call($method, ['constraints[phids][0]' => $objectPHID, 'attachments[projects]' => 1]);
     return PhabricatorAPI::getFirstResult($reply)->attachments->projects->projectPHIDs;
 }