public function testTorrentSetLocationShouldThrowAnExceptionWithAnInvalidSessionId() { $location = '/path/to/file'; $requestBody = '{"method":"torrent-set-location","arguments":{"ids":[42,1337],"location":"'; $requestBody .= $location . '","move":false}}'; $invalidSessionId = uniqid(); $this->sendRequest($requestBody, $invalidSessionId)->andThrow($this->generateCSRFException()); try { $this->rpcClient->torrentSetLocation($invalidSessionId, self::TORRENT_IDS, $location); } catch (CSRFException $e) { $this->assertSame($this->sessionId, $e->getSessionId()); } }