diff options
Diffstat (limited to 'tests/lib/AppFramework/Http/RequestTest.php')
-rw-r--r-- | tests/lib/AppFramework/Http/RequestTest.php | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/tests/lib/AppFramework/Http/RequestTest.php b/tests/lib/AppFramework/Http/RequestTest.php index 2ad660405f3..000a05f7913 100644 --- a/tests/lib/AppFramework/Http/RequestTest.php +++ b/tests/lib/AppFramework/Http/RequestTest.php @@ -31,7 +31,7 @@ class RequestTest extends \Test\TestCase { /** @var CsrfTokenManager */ protected $csrfTokenManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); if (in_array('fakeinput', stream_get_wrappers())) { @@ -45,7 +45,7 @@ class RequestTest extends \Test\TestCase { ->disableOriginalConstructor()->getMock(); } - protected function tearDown() { + protected function tearDown(): void { stream_wrapper_unregister('fakeinput'); parent::tearDown(); } @@ -103,10 +103,10 @@ class RequestTest extends \Test\TestCase { } - /** - * @expectedException \RuntimeException - */ + public function testImmutableArrayAccess() { + $this->expectException(\RuntimeException::class); + $vars = array( 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'), 'method' => 'GET' @@ -123,10 +123,10 @@ class RequestTest extends \Test\TestCase { $request['nickname'] = 'Janey'; } - /** - * @expectedException \RuntimeException - */ + public function testImmutableMagicAccess() { + $this->expectException(\RuntimeException::class); + $vars = array( 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'), 'method' => 'GET' @@ -143,10 +143,10 @@ class RequestTest extends \Test\TestCase { $request->{'nickname'} = 'Janey'; } - /** - * @expectedException \LogicException - */ + public function testGetTheMethodRight() { + $this->expectException(\LogicException::class); + $vars = array( 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'), 'method' => 'GET', @@ -1246,11 +1246,11 @@ class RequestTest extends \Test\TestCase { $this->assertSame('www.owncloud.org', self::invokePrivate($request, 'getOverwriteHost')); } - /** - * @expectedException \Exception - * @expectedExceptionMessage The requested uri(/foo.php) cannot be processed by the script '/var/www/index.php') - */ + public function testGetPathInfoNotProcessible() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('The requested uri(/foo.php) cannot be processed by the script \'/var/www/index.php\')'); + $request = new Request( [ 'server' => [ @@ -1267,11 +1267,11 @@ class RequestTest extends \Test\TestCase { $request->getPathInfo(); } - /** - * @expectedException \Exception - * @expectedExceptionMessage The requested uri(/foo.php) cannot be processed by the script '/var/www/index.php') - */ + public function testGetRawPathInfoNotProcessible() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('The requested uri(/foo.php) cannot be processed by the script \'/var/www/index.php\')'); + $request = new Request( [ 'server' => [ |