2020-01-11 13:58:02 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Tests\E2E\Scopes;
|
|
|
|
|
|
|
|
|
|
trait SideClient
|
|
|
|
|
{
|
2024-12-15 09:22:05 +00:00
|
|
|
public function getHeaders(bool $devKey = true): array
|
2020-01-11 13:58:02 +00:00
|
|
|
{
|
2024-12-15 09:22:05 +00:00
|
|
|
$headers = [
|
2020-01-12 21:28:26 +00:00
|
|
|
'origin' => 'http://localhost',
|
2022-05-23 14:54:50 +00:00
|
|
|
'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $this->getUser()['session'],
|
2024-12-15 09:22:05 +00:00
|
|
|
|
2020-01-12 21:28:26 +00:00
|
|
|
];
|
2024-12-15 10:25:22 +00:00
|
|
|
if ($devKey && isset($this->getProject()['devKey'])) {
|
2024-12-15 09:22:05 +00:00
|
|
|
$headers['x-appwrite-dev-key'] = $this->getProject()['devKey'];
|
|
|
|
|
}
|
|
|
|
|
return $headers;
|
2020-01-11 13:58:02 +00:00
|
|
|
}
|
2020-11-26 06:31:59 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public function getSide()
|
|
|
|
|
{
|
|
|
|
|
return 'client';
|
|
|
|
|
}
|
2020-01-11 13:58:02 +00:00
|
|
|
}
|