示例#1
0
文件: QuoteTest.php 项目: avz/php-b2
 public function testQuoteMysqli()
 {
     $mysqli = $this->getMockBuilder('mysqli')->setMethods(array('escape_string'))->getMock();
     $mysqli->expects($this->once())->method('escape_string')->with($this->equalTo('hello world'))->will($this->returnValue('{hello world}'));
     $quote = \b2\Quote::createFromMysqli($mysqli);
     $this->assertSame("'{hello world}'", $quote->value('hello world'));
     $this->assertSame('NULL', $quote->value(null));
     $this->assertSame('1', $quote->value(true));
     $this->assertSame('0', $quote->value(false));
     $this->assertSame('`hello`.`world`', $quote->identifier('hello.world'));
 }
示例#2
0
文件: Constant.php 项目: avz/php-b2
 public function toString(\b2\Quote $quote)
 {
     return $quote->value($this->constant);
 }
示例#3
0
文件: AnyList.php 项目: avz/php-b2
 public function toString(\b2\Quote $quote)
 {
     return $quote->values($this->literals);
 }
示例#4
0
文件: Identifier.php 项目: avz/php-b2
 public function toString(\b2\Quote $quote)
 {
     return $quote->identifier($this->identifier);
 }