Page MenuHomeDevCentral

PhabricatorAPITest.php
No OneTemporary

PhabricatorAPITest.php

<?php
namespace Nasqueron\Notifications\Tests\Phabricator;
use Nasqueron\Notifications\Phabricator\PhabricatorAPI;
use Nasqueron\Notifications\Tests\TestCase;
class PhabricatorAPITest extends TestCase {
public function testForInstance () {
$this->assertInstanceOf(
'\Nasqueron\Notifications\Phabricator\PhabricatorAPI',
PhabricatorAPI::forInstance("https://phabricator.acme.tld")
);
}
public function testForProject () {
$this->assertInstanceOf(
'\Nasqueron\Notifications\Phabricator\PhabricatorAPI',
PhabricatorAPI::forInstance("https://phabricator.acme.tld")
);
}
public function testForInstanceWhere () {
$this->expectException(\RuntimeException::class);
PhabricatorAPI::forInstance("https://notfound.acme.tld");
}
public function testForProjectWhenProjectDoesNotExist () {
$this->expectException(\RuntimeException::class);
PhabricatorAPI::forProject("NotFound");
}
public function testGetFirstResultForObject () {
$result = new \stdClass;
$result->data = ["first", "second", "third"];
$this->assertEquals("first", PhabricatorAPI::getFirstResult($result));
}
public function testGetFirstResultForIterable () {
$result = ["first", "second", "third"];
$this->assertEquals("first", PhabricatorAPI::getFirstResult($result));
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Nov 17, 15:55 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3168799
Default Alt Text
PhabricatorAPITest.php (1 KB)

Event Timeline