ultimix
unit_tests.php
Go to the documentation of this file.
1 <?php
2 
3  class SecurityTests{
4 
6 
21  function __construct( $thePackageVersion )
22  {
23  $this->PackageVersion = $thePackageVersion;
24  }
25 
36  function testInt()
37  {
38  $Security = & get_package( 'security' , $this->PackageVersion );
39 
40  if( $Security->get( 'id123_a4567' , 'integer' ) !== 1234567 )
41  {
42  $this->setStatus( PUnit_Result_Run::StatusFail );
43  }
44  }
45 
56  function testFloat1()
57  {
58  $Security = & get_package( 'security' , $this->PackageVersion );
59 
60  if( $Security->get( '1.2f34' , float ) !== 1.234 )
61  {
62  $this->setStatus( PUnit_Result_Run::StatusFail );
63  }
64  }
65 
76  function testFloat2()
77  {
78  $Security = & get_package( 'security' , $this->PackageVersion );
79 
80  if( $Security->get( '1.234e+1' , float ) !== 1.234e+1 )
81  {
82  $this->setStatus( PUnit_Result_Run::StatusFail );
83  }
84  }
85 
96  function testFloat3()
97  {
98  $Security = & get_package( 'security' , $this->PackageVersion );
99 
100  if( $Security->get( '1.23f4e+1' , float ) !== 1.234e+1 )
101  {
102  $this->setStatus( PUnit_Result_Run::StatusFail );
103  }
104  }
105 
116  function testCommand()
117  {
118  $Security = & get_package( 'security' , $this->PackageVersion );
119 
120  if( $Security->get( 'asdf_:-фыва<>ASDF' , 'command' ) !== 'asdf_:-ASDF' )
121  {
122  $this->setStatus( PUnit_Result_Run::StatusFail );
123  }
124  }
125 
136  function testCommand()
137  {
138  $Security = & get_package( 'security' , $this->PackageVersion );
139 
140  if( $Security->get( '<hr>something&' , 'command' ) !== '&lt;hr&gt;something&amp;' )
141  {
142  $this->setStatus( PUnit_Result_Run::StatusFail );
143  }
144  }
145  }
146 
147 ?>