[go: up one dir, main page]

Menu

[0376ad]: / tests / saltTest.php  Maximize  Restore  History

Download this file

22 lines (16 with data), 536 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<?php
ob_start();
require_once('../web/salt.php');
$GLOBALS['responseSalt'] = ob_get_clean();
require_once('simpletest/autorun.php');
class SaltTest extends UnitTestCase {
function testSaltInSessionShouldNotBeEmtpy() {
$this->assertNotNull($_SESSION['salt']);
$this->assertTrue(strlen($_SESSION['salt']) == 32);
}
function testJsonReturnShouldNotBeEmtpy() {
$this->assertNotNull($GLOBALS['responseSalt']);
$this->assertTrue(strlen($GLOBALS['responseSalt']) > 32); // Bigger because of Json formating
}
}
?>