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