2
0

MssqlTest.php 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Db
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. require_once 'Zend/Db/Statement/Pdo/TestCommon.php';
  22. PHPUnit_Util_Filter::addFileToFilter(__FILE__);
  23. class Zend_Db_Statement_Pdo_MssqlTest extends Zend_Db_Statement_Pdo_TestCommon
  24. {
  25. public function testStatementGetColumnMeta()
  26. {
  27. $this->markTestSkipped($this->getDriver() . ' does not support meta data.');
  28. }
  29. public function testStatementExecuteWithParams()
  30. {
  31. $products = $this->_db->quoteIdentifier('zfproducts');
  32. // Make IDENTITY column accept explicit value.
  33. // This can be done in only one table in a given session.
  34. $this->_db->getConnection()->exec("SET IDENTITY_INSERT $products ON");
  35. parent::testStatementExecuteWithParams();
  36. $this->_db->getConnection()->exec("SET IDENTITY_INSERT $products OFF");
  37. }
  38. public function testStatementBindParamByPosition()
  39. {
  40. $products = $this->_db->quoteIdentifier('zfproducts');
  41. // Make IDENTITY column accept explicit value.
  42. // This can be done in only one table in a given session.
  43. $this->_db->getConnection()->exec("SET IDENTITY_INSERT $products ON");
  44. parent::testStatementBindParamByPosition();
  45. $this->_db->getConnection()->exec("SET IDENTITY_INSERT $products OFF");
  46. }
  47. public function testStatementBindParamByName()
  48. {
  49. $products = $this->_db->quoteIdentifier('zfproducts');
  50. // Make IDENTITY column accept explicit value.
  51. // This can be done in only one table in a given session.
  52. $this->_db->getConnection()->exec("SET IDENTITY_INSERT $products ON");
  53. parent::testStatementBindParamByName();
  54. $this->_db->getConnection()->exec("SET IDENTITY_INSERT $products OFF");
  55. }
  56. public function testStatementBindValueByPosition()
  57. {
  58. $products = $this->_db->quoteIdentifier('zfproducts');
  59. // Make IDENTITY column accept explicit value.
  60. // This can be done in only one table in a given session.
  61. $this->_db->getConnection()->exec("SET IDENTITY_INSERT $products ON");
  62. parent::testStatementBindValueByPosition();
  63. $this->_db->getConnection()->exec("SET IDENTITY_INSERT $products OFF");
  64. }
  65. public function testStatementBindValueByName()
  66. {
  67. $products = $this->_db->quoteIdentifier('zfproducts');
  68. // Make IDENTITY column accept explicit value.
  69. // This can be done in only one table in a given session.
  70. $this->_db->getConnection()->exec("SET IDENTITY_INSERT $products ON");
  71. parent::testStatementBindValueByName();
  72. $this->_db->getConnection()->exec("SET IDENTITY_INSERT $products OFF");
  73. }
  74. public function getDriver()
  75. {
  76. return 'Pdo_Mssql';
  77. }
  78. }