@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final 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}