Example #1
0
 public function setup()
 {
     parent::setUp();
     if (!self::$object) {
         self::$object = self::$DI['app']['acl']->get(self::$DI['user']);
     }
 }
Example #2
0
		//(which has been granted admin priviliges in installhandler).
		$this->acl_user_alice->add_to_group( 'admin' );
		$admin_group = UserGroup::get_by_name('admin');
		if ( $admin_group instanceOf UserGroup ) {
			$admin_group->update();
		}

		$this->assert_true(
			$this->acl_user_alice->can( 'admin' ),
			'Admin user does not have admin permission.'
		);

		$this->assert_false(
			$this->acl_user_bob->can( 'admin' ),
			'Unpriviliged user has admin permission.'
		);

	}

	public function teardown()
	{
		$this->acl_group->delete();
		$this->acl_user_alice->delete();
		$this->acl_user_bob->delete();
	}
}

ACLTest::run_one( 'ACLTest' );

?>