keyExists() 공개 정적인 메소드

Check that a value key exists.
public static keyExists ( string $keyName ) : KeyExists
$keyName string The key name.
리턴 Webmozart\Expression\Constraint\KeyExists The created expression.
예제 #1
0
 public function orKeyExists($keyName)
 {
     return $this->orX(Expr::keyExists($keyName));
 }
예제 #2
0
 public function testMatch()
 {
     $target = new InstallTarget('local', 'symlink', 'web', '/%s', array('param1' => 'value1', 'param2' => 'value2'));
     $this->assertFalse($target->match(Expr::same('foobar', InstallTarget::NAME)));
     $this->assertTrue($target->match(Expr::same('local', InstallTarget::NAME)));
     $this->assertFalse($target->match(Expr::same('foobar', InstallTarget::INSTALLER_NAME)));
     $this->assertTrue($target->match(Expr::same('symlink', InstallTarget::INSTALLER_NAME)));
     $this->assertFalse($target->match(Expr::same('foobar', InstallTarget::LOCATION)));
     $this->assertTrue($target->match(Expr::same('web', InstallTarget::LOCATION)));
     $this->assertFalse($target->match(Expr::same('foobar', InstallTarget::URL_FORMAT)));
     $this->assertTrue($target->match(Expr::same('/%s', InstallTarget::URL_FORMAT)));
     $this->assertFalse($target->match(Expr::key(InstallTarget::PARAMETER_VALUES, Expr::keyExists('foobar'))));
     $this->assertTrue($target->match(Expr::key(InstallTarget::PARAMETER_VALUES, Expr::keyExists('param1'))));
 }
예제 #3
0
 public function testMatch()
 {
     $server = new Server('localhost', 'symlink', 'web', '/%s', array('param1' => 'value1', 'param2' => 'value2'));
     $this->assertFalse($server->match(Expr::same('foobar', Server::NAME)));
     $this->assertTrue($server->match(Expr::same('localhost', Server::NAME)));
     $this->assertFalse($server->match(Expr::same('foobar', Server::INSTALLER_NAME)));
     $this->assertTrue($server->match(Expr::same('symlink', Server::INSTALLER_NAME)));
     $this->assertFalse($server->match(Expr::same('foobar', Server::DOCUMENT_ROOT)));
     $this->assertTrue($server->match(Expr::same('web', Server::DOCUMENT_ROOT)));
     $this->assertFalse($server->match(Expr::same('foobar', Server::URL_FORMAT)));
     $this->assertTrue($server->match(Expr::same('/%s', Server::URL_FORMAT)));
     $this->assertFalse($server->match(Expr::key(Server::PARAMETER_VALUES, Expr::keyExists('foobar'))));
     $this->assertTrue($server->match(Expr::key(Server::PARAMETER_VALUES, Expr::keyExists('param1'))));
 }
예제 #4
0
 public function andKeyExists($keyName)
 {
     return $this->andX(Expr::keyExists($keyName));
 }