setSecurityProvider() public static method

Set the security provider
public static setSecurityProvider ( Opis\Closure\SecurityProviderInterface $provider )
$provider Opis\Closure\SecurityProviderInterface Security provider
Beispiel #1
0
 public function testSecureClosureIntegrityFail()
 {
     $this->setExpectedException('Opis\\Closure\\SecurityException');
     SecureClosure::setSecurityProvider(new DefaultSecurityProvider('secret'));
     $closure = function () {
         /*x*/
     };
     $value = serialize(new SecureClosure($closure));
     $value = str_replace('/*x*/', '/*y*/', $value);
     $value = unserialize($value);
 }