public function testMissingPassword() { $request = $this->request->withMethod('GET')->withHeader('PHP_AUTH_USER', 'admin')->withHeader('PHP_AUTH_PW', 'admin'); try { $response = $this->response; $next = function ($req, $res) { return $res; }; $mw = new Rule('admin', '', '/secured-page'); $newResponse = $mw($request, $response, $next); } catch (\Exception $e) { } $this->assertInstanceOf('RuntimeException', $e); }