예제 #1
0
 public function testQuoteValueWithSqlServer()
 {
     if (!$this->adapters['pdo_sqlsrv']) {
         $this->markTestSkipped('SQLServer (pdo_sqlsrv) not configured in unit test configuration file');
     }
     $sqlite = new SqlServer($this->adapters['pdo_sqlsrv']);
     $value = $sqlite->quoteValue('value');
     $this->assertEquals('\'value\'', $value);
 }
예제 #2
0
 /**
  * @covers Zend\Db\Adapter\Platform\SqlServer::quoteIdentifierInFragment
  */
 public function testQuoteIdentifierInFragment()
 {
     $this->assertEquals('[foo].[bar]', $this->platform->quoteIdentifierInFragment('foo.bar'));
     $this->assertEquals('[foo] as [bar]', $this->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')));
 }
예제 #3
0
 /**
  * @covers Zend\Db\Adapter\Platform\SqlServer::quoteIdentifierInFragment
  */
 public function testQuoteIdentifierInFragment()
 {
     $this->assertEquals('[foo].[bar]', $this->platform->quoteIdentifierInFragment('foo.bar'));
     $this->assertEquals('[foo] as [bar]', $this->platform->quoteIdentifierInFragment('foo as bar'));
 }
예제 #4
0
 /**
  * @covers Zend\Db\Adapter\Platform\SqlServer::setDriver
  */
 public function testSetDriver()
 {
     $driver = new Pdo(array('pdodriver' => 'sqlsrv'));
     $this->platform->setDriver($driver);
 }
예제 #5
0
 /**
  * @group ZF2-386
  * @covers Zend\Db\Adapter\Platform\SqlServer::quoteIdentifierInFragment
  */
 public function testQuoteIdentifierInFragmentIgnoresSingleCharSafeWords()
 {
     $this->assertEquals('([foo].[bar] = [boo].[baz])', $this->platform->quoteIdentifierInFragment('(foo.bar = boo.baz)', array('(', ')', '=')));
 }