lithium\tests\cases\storage\session\strategy\EncryptTest::testDelete PHP Method

testDelete() public method

public testDelete ( )
    public function testDelete()
    {
        $encrypt = new Encrypt(array('secret' => $this->secret));
        $key = 'fookey';
        $value = 'barvalue';
        $result = $encrypt->write($value, array('class' => $this->mock, 'key' => $key));
        $this->assertNotEmpty($result);
        $cookie = MockCookieSession::data();
        $result = $encrypt->read($key, array('class' => $this->mock, 'key' => $key));
        $this->assertEqual($value, $result);
        $result = $encrypt->delete($key, array('class' => $this->mock, 'key' => $key));
        $cookie = MockCookieSession::data();
        $this->assertEmpty($cookie['__encrypted']);
        $result = $encrypt->read($key, array('class' => $this->mock));
        $this->assertEmpty($result);
    }