예제 #1
0
 public function testInit()
 {
     $options = ['configPath' => '@tests/rbac/init'];
     $parser = new RbacConfigParser($options);
     $parser->fill();
     $dataSet = $this->createXMLDataSet(__DIR__ . '/data/test-init.xml');
     $authItemTable = $this->getConnection()->createQueryTable('auth_item', 'SELECT `name`, `type`, `description`, `rule_name` FROM `auth_item`');
     $this->assertTablesEqual($dataSet->getTable('auth_item'), $authItemTable);
     $authItemChildTable = $this->getConnection()->createQueryTable('auth_item_child', 'SELECT * FROM `auth_item_child`');
     $this->assertTablesEqual($dataSet->getTable('auth_item_child'), $authItemChildTable);
     $authRuleTable = $this->getConnection()->createQueryTable('auth_rule', 'SELECT `name` FROM `auth_rule`');
     $this->assertTablesEqual($dataSet->getTable('auth_rule'), $authRuleTable);
 }
예제 #2
0
 /**
  * Update data from configuration
  * @param string $configPath
  */
 public function actionUpdate($configPath)
 {
     $parser = new RbacConfigParser(['configPath' => $configPath]);
     $parser->fill();
 }