예제 #1
0
 /**
  * Memory::isRole parameter validation
  */
 public function testMemoryIsRoleParameter()
 {
     $acl = new Phalcon\Acl\Adapter\Memory();
     $tests = array('int' => 123, 'double' => 123.456, 'array' => array('test'), 'empty_array' => array(), 'bool' => false, 'object' => new \stdClass(), 'null' => null);
     $exceptions = 0;
     foreach ($tests as $name => $test) {
         try {
             $acl->isRole($test);
         } catch (Phalcon\Acl\Exception $e) {
             $exceptions++;
         }
     }
     $this->assertEquals($exceptions, 7);
 }