/** * Memory::addInherit parameter validation */ public function testMemoryAddInheritParameter() { $acl = new Phalcon\Acl\Adapter\Memory(); $tests = array('int' => 123, 'double' => 123.456, 'array' => array('test'), 'empty_array' => array(), 'bool' => false, 'object' => new \stdClass(), 'string' => 'test', 'null' => null); $exceptions = 0; foreach ($tests as $name => $test) { if ($name === 'string') { continue; } foreach ($tests as $second) { try { $acl->addInherit($test, $second); } catch (Phalcon\Acl\Exception $e) { $exceptions++; } } } $this->assertEquals($exceptions, 56); $exceptions = 0; foreach ($tests as $name => $test) { if ($name === 'string') { continue; } foreach ($tests as $second) { try { $acl->addInherit($second, $test); } catch (Phalcon\Acl\Exception $e) { $exceptions++; } } } $this->assertEquals($exceptions, 56); }