Beispiel #1
0
 public function testGrantToWithUserSpec()
 {
     $specOn = UserSpecification::createWithFormat(NULL, 'localuser@localhost');
     $specTo = UserSpecification::createWithFormat(NULL, 'externaluser@somehost');
     $q = new GrantQuery();
     $q->grant('PROXY')->on($specOn)->to($specTo);
     $this->assertSql('GRANT PROXY ON `localuser`@`localhost` TO `externaluser`@`somehost`', $q);
 }
Beispiel #2
0
 public function user($spec = NULL)
 {
     $user = NULL;
     if (is_string($spec) && ($user = UserSpecification::createWithFormat($this, $spec))) {
         $this->userSpecifications[] = $user;
     } else {
         $this->userSpecifications[] = $user = new UserSpecification($this);
     }
     return $user;
 }
Beispiel #3
0
 public function to($spec)
 {
     if ($spec instanceof UserSpecification) {
         $this->to[] = $spec;
     } elseif (strpos($spec, '@') !== false) {
         $user = UserSpecification::createWithFormat($this, $spec);
         $this->to[] = $user;
     } else {
         throw new InvalidArgumentException("Unsupported user specification: {$spec}");
     }
     return $this;
 }
Beispiel #4
0
 public function _for($userspec)
 {
     $this->for = UserSpecification::createWithFormat($this, $userspec);
     return $this;
 }
 /**
  * @expectedException BadMethodCallException
  */
 public function testBadMethodCall()
 {
     $spec = new UserSpecification(NULL);
     $spec->foo();
 }