1
0
mirror of https://github.com/Rudloff/alltube.git synced 2024-06-22 07:06:40 +02:00

Fix cookie settings in tests

This commit is contained in:
Pierre Rudloff 2017-12-05 14:37:23 +01:00
parent 5cd6ea0c44
commit 6b73026194
3 changed files with 3 additions and 2 deletions

View File

@ -42,7 +42,6 @@ class LocaleManager
{
$session_factory = new \Aura\Session\SessionFactory();
$session = $session_factory->newInstance($cookies);
$session->setCookieParams(['httponly' => true]);
$this->sessionSegment = $session->getSegment('Alltube\LocaleManager');
$cookieLocale = $this->sessionSegment->get('locale');
if (isset($cookieLocale)) {

View File

@ -27,6 +27,7 @@ class LocaleManagerTest extends TestCase
protected function setUp()
{
$this->localeManager = new LocaleManager();
$_SESSION['Alltube\LocaleManager']['locale'] = 'foo_BAR';
}
/**
@ -36,7 +37,6 @@ class LocaleManagerTest extends TestCase
*/
public function testConstructorWithCookies()
{
$_SESSION['Alltube\LocaleManager']['locale'] = 'foo_BAR';
$localeManager = new LocaleManager([]);
$this->assertEquals('foo_BAR', (string) $localeManager->getLocale());
}

View File

@ -9,6 +9,8 @@ use Alltube\PlaylistArchiveStream;
*/
require_once __DIR__.'/../vendor/autoload.php';
ini_set('session.use_cookies', 0);
session_cache_limiter('');
session_start();
stream_wrapper_register('playlist', PlaylistArchiveStream::class);