コード例 #1
0
ファイル: MysqlTest.php プロジェクト: rajanlamic/IntTest
 /**
  * @covers Zend\Db\Adapter\Platform\Mysql::quoteIdentifierInFragment
  */
 public function testQuoteIdentifierInFragment()
 {
     $this->assertEquals('`foo`.`bar`', $this->platform->quoteIdentifierInFragment('foo.bar'));
     $this->assertEquals('`foo` as `bar`', $this->platform->quoteIdentifierInFragment('foo as bar'));
     $this->assertEquals('`$TableName`.`bar`', $this->platform->quoteIdentifierInFragment('$TableName.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')));
 }
コード例 #2
0
ファイル: MysqlTest.php プロジェクト: navassouza/zf2
 /**
  * @covers Zend\Db\Adapter\Platform\Mysql::quoteIdentifierInFragment
  */
 public function testQuoteIdentifierInFragment()
 {
     $this->assertEquals('`foo`.`bar`', $this->platform->quoteIdentifierInFragment('foo.bar'));
     $this->assertEquals('`foo` as `bar`', $this->platform->quoteIdentifierInFragment('foo as bar'));
 }
コード例 #3
0
ファイル: MysqlTest.php プロジェクト: rcastardo/zf2
 /**
  * @group ZF2-386
  * @covers Zend\Db\Adapter\Platform\Mysql::quoteIdentifierInFragment
  */
 public function testQuoteIdentifierInFragmentIgnoresSingleCharSafeWords()
 {
     $this->assertEquals('(`foo`.`bar` = `boo`.`baz`)', $this->platform->quoteIdentifierInFragment('(foo.bar = boo.baz)', array('(', ')', '=')));
 }