コード例 #1
0
 public function testBizRule()
 {
     $perm = new Permission(['code' => 'test', 'name' => 'Test codename', 'is_default' => true, 'bizrule' => '$foo=="bar"']);
     $this->assertTrue($perm->save());
     $this->p->fetchData();
     $this->assertTrue($this->p->canBizRule('test', ['foo' => 'bar']));
     $this->assertFalse($this->p->canBizRule('test', ['foo' => 'default']));
 }