Пример #1
0
 public function testTorrentRenamePathShouldThrowAnExceptionWithAnInvalidSessionId()
 {
     $oldPath = 'torrent.iso';
     $newPath = 'new-torrent.iso';
     $invalidSessionId = uniqid();
     $requestBody = sprintf('{"method":"torrent-rename-path","arguments":{"ids":[42],"path":"%s","name":"%s"}}', $oldPath, $newPath);
     $this->sendRequest($requestBody, $invalidSessionId)->andThrow($this->generateCSRFException());
     try {
         $this->rpcClient->torrentRenamePath($invalidSessionId, 42, $oldPath, $newPath);
     } catch (CSRFException $e) {
         $this->assertSame($this->sessionId, $e->getSessionId());
     }
 }