public function testTorrentVerifyShouldThrowAnExceptionWithAnInvalidSessionId() { $requestBody = '{"method":"torrent-verify","arguments":{"ids":[42,1337]}}'; $invalidSessionId = uniqid(); $this->sendRequest($requestBody, $invalidSessionId)->andThrow($this->generateCSRFException()); try { $this->rpcClient->torrentVerify($invalidSessionId, self::TORRENT_IDS); } catch (CSRFException $e) { $this->assertSame($this->sessionId, $e->getSessionId()); } }