Exemple #1
0
 /**
  * @covers Zend\Db\Adapter\Platform\IbmDb2::quoteIdentifierInFragment
  */
 public function testQuoteIdentifierInFragment()
 {
     $this->assertEquals('"foo"."bar"', $this->platform->quoteIdentifierInFragment('foo.bar'));
     $this->assertEquals('"foo" as "bar"', $this->platform->quoteIdentifierInFragment('foo as bar'));
     $platform = new IbmDb2(array('quote_identifiers' => false));
     $this->assertEquals('foo.bar', $platform->quoteIdentifierInFragment('foo.bar'));
     $this->assertEquals('foo as bar', $platform->quoteIdentifierInFragment('foo as bar'));
     // single char words
     $this->assertEquals('("foo"."bar" = "boo"."baz")', $this->platform->quoteIdentifierInFragment('(foo.bar = boo.baz)', array('(', ')', '=')));
     // case insensitive safe words
     $this->assertEquals('("foo"."bar" = "boo"."baz") AND ("foo"."baz" = "boo"."baz")', $this->platform->quoteIdentifierInFragment('(foo.bar = boo.baz) AND (foo.baz = boo.baz)', array('(', ')', '=', 'and')));
 }