Page MenuHomePhorge

EnigmaEngine.php
No OneTemporary

Authored By
Unknown
Size
1023 B
Referenced Files
None
Subscribers
None

EnigmaEngine.php

<?php
class Enigma_EnigmaEngine extends PHPUnit\Framework\TestCase
{
static function setUpBeforeClass(): void
{
include_once __DIR__ . '/../enigma.php';
include_once __DIR__ . '/../lib/enigma_engine.php';
}
/**
* Test password_handler()
*/
function test_password_handler()
{
$rcube = rcube::get_instance();
$plugin = new enigma($rcube->plugins);
$engine = new enigma_engine($plugin);
unset($_SESSION['enigma_pass']);
$engine->password_handler();
$this->assertTrue(!array_key_exists('enigma_pass', $_SESSION));
$this->assertSame([], $engine->get_passwords());
$_POST = ['_keyid' => 'abc', '_passwd' => '123<a>456'];
$time = time();
$engine->password_handler();
$store = unserialize($rcube->decrypt($_SESSION['enigma_pass']));
$this->assertSame(['123<a>456', $time], $store['ABC']);
$this->assertSame(['ABC' => '123<a>456'], $engine->get_passwords());
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Apr 24, 1:17 PM (3 d, 10 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18774504
Default Alt Text
EnigmaEngine.php (1023 B)

Event Timeline