MockSuperuser constructor

MockSuperuser({
  1. bool isSuperuser = false,
  2. bool isActivated = false,
  3. String whoAmI = "",
  4. Set<String> groups = const {},
  5. int matchingFlag = OSString.DEFAULT_MATCH,
})

Create mocked properties of SuperuserInterface to emulate superuser status.

whoAmI and groups will be applied the same OSString matching method by configuring matchingFlag, which has been instructed in OSString.new already.

Implementation

MockSuperuser({
  this.isSuperuser = false,
  this.isActivated = false,
  String whoAmI = "",
  Set<String> groups = const {},
  int matchingFlag = OSString.DEFAULT_MATCH,
}) : whoAmI = OSString(whoAmI, matchingFlag),
     groups = OSStringsSet.fromStrings(groups, matchingFlag);