1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-21 05:41:58 +02:00

Issue #5482 Session handling of array data.

This commit is contained in:
camer0n
2025-04-28 08:59:28 -07:00
parent 8b5a83e4bf
commit 46696f2124
3 changed files with 132 additions and 78 deletions

View File

@@ -63,7 +63,7 @@
);
$result = $this->sess->get('clear');
$this->assertSame($expected, $result);
$this::assertSame($expected, $result);
}
@@ -77,7 +77,7 @@
$result = $this->sess->get('whatever');
$this->assertEquals($expected, $result);
$this::assertEquals($expected, $result);
// Multi-dimensional array support.
@@ -92,9 +92,30 @@
);
$result = $newsess->get('customer');
$this->assertSame($expected, $result);
$this::assertSame($expected, $result);
}
function testSetGetArrayDepth()
{
// Flat
$array = ['a', 'b', 'c'];
e107::getSession()->set('thememanager', $array);
$result = e107::getSession()->get('thememanager');
$this::assertSame($array, $result);
// 1-level deep
$array2 = ['d', 'e', 'f'];
e107::getSession()->set('thememanager/online', $array2);
$result = e107::getSession()->get('thememanager/online');
$this::assertSame($array2, $result);
// 2-levels deep
$array3 = ['g', 'h', 'i'];
e107::getSession()->set('thememanager/online/55', $array3);
$result = e107::getSession()->get('thememanager/online/55');
$this::assertSame($array3, $result);
}
/*
public function testGetOption()
{