-
-
Notifications
You must be signed in to change notification settings - Fork 319
/
050.phpt
44 lines (40 loc) · 680 Bytes
/
050.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--TEST--
Check for yar server __auth (throw exception)
--SKIPIF--
<?php
if (!extension_loaded("yar")) {
print "skip";
}
?>
--FILE--
<?php
include "yar.inc";
yar_server_start(<<<'PHP'
<?php
error_reporting(-1);
class Service_Provider {
protected function __auth($provider, $token) {
throw new Exception("go away");
}
public function info() {
return "okay";
}
}
$yar = new Yar_Server(new Service_Provider());
$yar->handle();
PHP
);
try {
$client = new Yar_Client(YAR_API_ADDRESS);
var_dump($client->info());
} catch (Exception $e) {
echo $e->getMessage();
}
?>
--CLEAN--
<?php
include 'yar.inc';
yar_server_cleanup();
?>
--EXPECT--
go away