read() public method

Read encryption method.
public read ( array $data, array $options = [] ) : mixed
$data array the Data being read.
$options array Options for this method.
return mixed Returns the decrypted key or the dataset.
 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->assertTrue($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->assertTrue(empty($cookie['__encrypted']));
     $result = $encrypt->read($key, array('class' => $this->mock));
     $this->assertFalse($result);
 }