public function orKeyExists($keyName) { return $this->orX(Expr::keyExists($keyName)); }
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')))); }
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')))); }
public function andKeyExists($keyName) { return $this->andX(Expr::keyExists($keyName)); }