public function testRemoveIssueLabelIgnoresUnsetLabel() { $this->backendApi->expects($this->once())->method('all')->with(self::USER_NAME, self::REPO_NAME, 1234)->willReturn(array(array('name' => 'a'), array('name' => 'b'), array('name' => 'c'))); $this->backendApi->expects($this->never())->method('remove'); $this->assertSame(array('a', 'b', 'c'), $this->api->getIssueLabels(1234)); $this->api->removeIssueLabel(1234, 'd'); $this->assertSame(array('a', 'b', 'c'), $this->api->getIssueLabels(1234)); }
public function getIssueStatus($issueNumber) { $currentLabels = $this->labelsApi->getIssueLabels($issueNumber); foreach ($currentLabels as $label) { if (isset($this->labelToStatus[$label])) { return $this->labelToStatus[$label]; } } // No status set return; }
public function testGetIssueStatusReturnsNullIfNoneSet() { $this->labelsApi->expects($this->once())->method('getIssueLabels')->with(1234)->willReturn(array('Bug')); $this->assertNull($this->api->getIssueStatus(1234)); }