makePostCage() public static method

This utilizes a singleton pattern to get around scoping issues
public static makePostCage ( string $config_file = null, boolean $strict = true ) : Cage
$config_file string
$strict boolean whether or not to nullify the superglobal array
return Cage
/**
 * second level of scoping
 *
 */
function testScoping2()
{
    $cage_POST = Inspekt::makePostCage();
    echo "<pre>In " . __FUNCTION__ . "(): ";
    var_dump($cage_POST->testAlnum('/funky,_+=_\\|;:!@#$%^&*~time/0/0/`~foo,.+=_\\|;:!@#$%^&*~-bar'));
    echo "</pre>\n";
    echo "<pre>POST is not accessible here: ";
    var_dump($_POST);
    echo "</pre>\n";
}
Beispiel #2
0
 /**
  *
  */
 public function testMakePostCage()
 {
     $cage = Inspekt::makePostCage();
     $this->assertTrue($cage instanceof Cage);
 }
Beispiel #3
0
 /**
  *
  */
 public function testTestAlnum3()
 {
     $_POST = array();
     $_POST['b'] = '0';
     $cage_POST = Inspekt::makePostCage();
     $result = $cage_POST->testLessThan('b', 25);
     $this->assertSame('0', $result);
 }