Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/conduit/call/__tests__/ConduitCallTestCase.php
12262 views
1
<?php
2
3
final class ConduitCallTestCase extends PhabricatorTestCase {
4
5
public function testConduitPing() {
6
$call = new ConduitCall('conduit.ping', array());
7
$result = $call->execute();
8
9
$this->assertFalse(empty($result));
10
}
11
12
public function testConduitAuth() {
13
$call = new ConduitCall('user.whoami', array(), true);
14
15
$caught = null;
16
try {
17
$result = $call->execute();
18
} catch (ConduitException $ex) {
19
$caught = $ex;
20
}
21
22
$this->assertTrue(
23
($caught instanceof ConduitException),
24
pht(
25
'%s should require authentication.',
26
'user.whoami'));
27
}
28
}
29
30