Jyxo\Spl\ObjectCacheTest::testUnset PHP Method

testUnset() public method

Tests unset().
public testUnset ( )
    public function testUnset()
    {
        // Nothing is saved
        $this->assertFalse(isset($this->cache->{self::CACHE_KEY}));
        // Save and check
        $this->saveObject();
        $this->assertTrue(isset($this->cache->{self::CACHE_KEY}));
        // Unset the object and check
        unset($this->cache->{self::CACHE_KEY});
        $this->assertFalse(isset($this->cache->{self::CACHE_KEY}));
        // Save and check again
        $this->saveObject();
        $this->assertTrue(isset($this->cache->{self::CACHE_KEY}));
        $this->cache->clear();
    }