MockNoResult.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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_Validate
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /**
  22. * @see Zend_Db_Adapter_Abstract
  23. */
  24. require_once 'Zend/Db/Adapter/Abstract.php';
  25. /**
  26. * Mock Db adapter for Zend_Validate_Db tests
  27. *
  28. */
  29. class Db_MockNoResult extends Zend_Db_Adapter_Abstract
  30. {
  31. /**
  32. * Returns a fixed result
  33. *
  34. * @param string|Zend_Db_Select $sql An SQL SELECT statement.
  35. * @param mixed $bind Data to bind into SELECT placeholders.
  36. * @param mixed $fetchMode Override current fetch mode.
  37. * @return null
  38. */
  39. public function fetchRow($sql, $bind = array(), $fetchMode = null)
  40. {
  41. return null;
  42. }
  43. /**
  44. * Override for the constructor
  45. * @param array $config
  46. */
  47. public function __construct($config = null)
  48. {
  49. // Do Nothing.
  50. }
  51. /**
  52. * The below methods are un-needed, but need to be implemented for this to
  53. * be a concrete class
  54. */
  55. public function listTables()
  56. {
  57. return null;
  58. }
  59. public function describeTable($tableName, $schemaName = null)
  60. {
  61. return null;
  62. }
  63. protected function _connect()
  64. {
  65. return null;
  66. }
  67. public function isConnected()
  68. {
  69. return null;
  70. }
  71. public function closeConnection()
  72. {
  73. return null;
  74. }
  75. public function prepare($sql)
  76. {
  77. return null;
  78. }
  79. public function lastInsertId($tableName = null, $primaryKey = null)
  80. {
  81. return null;
  82. }
  83. protected function _beginTransaction()
  84. {
  85. return null;
  86. }
  87. protected function _commit()
  88. {
  89. return null;
  90. }
  91. protected function _rollBack()
  92. {
  93. return null;
  94. }
  95. public function setFetchMode($mode)
  96. {
  97. return null;
  98. }
  99. public function limit($sql, $count, $offset = 0)
  100. {
  101. return null;
  102. }
  103. public function supportsParameters($type)
  104. {
  105. return null;
  106. }
  107. public function getServerVersion()
  108. {
  109. return null;
  110. }
  111. }