/** * Utilities. */ public function aclPrivateTo($someone) { $acl = new ParseACL(); $acl->setReadAccess($someone, true); $acl->setWriteAccess($someone, true); return $acl; }
public function testACLRequiresObjectId() { $acl = new ParseACL(); try { $acl->setReadAccess(null, true); $this->fail('Exception should have thrown'); } catch (Exception $e) { } try { $acl->getReadAccess(null); $this->fail('Exception should have thrown'); } catch (Exception $e) { } try { $acl->setWriteAccess(null, true); $this->fail('Exception should have thrown'); } catch (Exception $e) { } try { $acl->getWriteAccess(null); $this->fail('Exception should have thrown'); } catch (Exception $e) { } $user = new ParseUser(); try { $acl->setReadAccess($user, true); $this->fail('Exception should have thrown'); } catch (Exception $e) { } try { $acl->getReadAccess($user); $this->fail('Exception should have thrown'); } catch (Exception $e) { } try { $acl->setWriteAccess($user, true); $this->fail('Exception should have thrown'); } catch (Exception $e) { } try { $acl->getWriteAccess($user); $this->fail('Exception should have thrown'); } catch (Exception $e) { } }