This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Using the session abstractionΒΆ

This extension provides an abstraction for reading and writing session data that facilitates unit-testing the session data.

In the code, reading and writing session data looks like this:

        'some data'
$value = tx_oelib_Session::getInstance(tx_oelib_session::TYPE_TEMPORARY)->getAsString('foo-sessionkey');

The session abstraction provides the types TYPE_TEMPORARY (which will cause the data to get lost once the browser is closed) and TYPE_USER (which will cause the data to get stored in the FE user session).

In the unit tests, you can replace real session handling with a fake session:

public function setUp() {
        $this->session = new tx_oelib_FakeSession();
        tx_oelib_Session::TYPE_TEMPORARY, $this->session

public function testAddToFavoritesWithNewItemCanAddItemToNonEmptySession() {
                tx_realty_pi1::FAVORITES_SESSION_KEY, $this->firstRealtyUid


                array($this->firstRealtyUid, $this->secondRealtyUid),