Odyssey
AlertTest.php
1 <?php
2 
3 use PHPUnit\Framework\TestCase;
4 
5 $sharedLibrary= "/var/www/html/shared/library";
6 
7 require_once("$sharedLibrary/hcuTranslate.i");
8 require_once("$sharedLibrary/cu_data.i");
9 
10 class AlertTests extends TestCase
11 {
12  public function setUp() {
13  }
14 
15 
16  public function test_limits()
17  {
18  $arrayLimits = Get_AlertLimits();
19 
20  // test the contents: should be empty
21  $this->assertArrayHasKey("bal", $arrayLimits["data"]);
22  $this->assertArrayHasKey("trans", $arrayLimits["data"]);
23  $this->assertArrayHasKey("check", $arrayLimits["data"]);
24  $this->assertArrayHasKey("loan", $arrayLimits["data"]);
25  }
26 
27  public function test_validate_error()
28  {
29  $MC = new hcu_talk_base( "en_US" );
30  $hbEnv = array();
31  $test = Validate_Alert($dbh, $hbEnv, $MC);
32 
33  $this->assertArrayHasKey( "errors", $test );
34  $this->assertGreaterThanOrEqual( 2, count($test["errors"]) );
35  }
36 }