From b86bc28af9b961266a2caeeb86c8f6f125adc412 Mon Sep 17 00:00:00 2001 From: iamchenxin Date: Mon, 1 Jun 2015 20:02:52 +0800 Subject: remote.test --- _test/tests/inc/remote.test.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to '_test') diff --git a/_test/tests/inc/remote.test.php b/_test/tests/inc/remote.test.php index d0d4eb7ce..037b1dc0b 100644 --- a/_test/tests/inc/remote.test.php +++ b/_test/tests/inc/remote.test.php @@ -160,10 +160,16 @@ class remote_test extends DokuWikiTest { $this->assertTrue($this->remote->hasAccess()); } + /** + * @expectedException RemoteAccessDeniedException + */ function test_hasAccessFail() { global $conf; $conf['remote'] = 0; - $this->assertFalse($this->remote->hasAccess()); + // the hasAccess() should throw a Exception to keep the same semantics with xmlrpc.php. + // because the user(xmlrpc) check remote before .--> (!$conf['remote']) die('XML-RPC server not enabled.'); + // so it must be a Exception when get here. + $this->remote->hasAccess(); } function test_hasAccessFailAcl() { -- cgit v1.2.3