Some more test work

- If test has session when we ask for the share, include session ID in the request cookies
This commit is contained in:
nathangray 2020-09-30 11:21:34 -06:00
parent 819dc8be7c
commit 501916c13e

View File

@ -540,7 +540,7 @@ class SharingBase extends LoggedInTest
$this->assertTrue(Vfs::is_readable('/'), 'Could not read root (/) from link'); $this->assertTrue(Vfs::is_readable('/'), 'Could not read root (/) from link');
// Check other paths // Check other paths
$this->assertFalse(Vfs::is_readable($path), "Was able to read $path as anoymous, it should be mounted as /"); $this->assertFalse(Vfs::is_readable($path), "Was able to read $path as anonymous, it should be mounted as /");
$this->assertFalse(Vfs::is_readable($path . '../')); $this->assertFalse(Vfs::is_readable($path . '../'));
} }
@ -557,6 +557,13 @@ class SharingBase extends LoggedInTest
$curl = curl_init($link); $curl = curl_init($link);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
$cookie = '';
if($GLOBALS['egw']->session->sessionid || $share['share_with'])
{
$session_id = $GLOBALS['egw']->session->sessionid ?: $share['share_with'];
$cookie .= ';'.Api\Session::EGW_SESSION_NAME."={$session_id}";
}
curl_setopt($curl, CURLOPT_COOKIE, $cookie);
$html = curl_exec($curl); $html = curl_exec($curl);
curl_close($curl); curl_close($curl);