TestMockRow.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. * @version $Id$
  21. */
  22. /**
  23. * @see Zend_Db_Table_Row_Abstract
  24. */
  25. require_once 'Zend/Db/Table/Row/Abstract.php';
  26. PHPUnit_Util_Filter::addFileToFilter(__FILE__);
  27. /**
  28. * @category Zend
  29. * @package Zend_Db
  30. * @subpackage UnitTests
  31. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  32. * @license http://framework.zend.com/license/new-bsd New BSD License
  33. */
  34. class Zend_Db_Table_Row_TestMockRow extends Zend_Db_Table_Row_Abstract
  35. {
  36. public $parentTable = null;
  37. public $dependentTable = null;
  38. public $ruleKey = null;
  39. public $matchTable = null;
  40. public $intersectionTable = null;
  41. public $callerRefRuleKey = null;
  42. public $matchRefRuleKey = null;
  43. public function findDependentRowset($dependentTable, $ruleKey = null, Zend_Db_Table_Select $select = null)
  44. {
  45. $this->dependentTable = $dependentTable;
  46. $this->ruleKey = $ruleKey;
  47. }
  48. public function findParentRow($parentTable, $ruleKey = null, Zend_Db_Table_Select $select = null)
  49. {
  50. $this->parentTable = $parentTable;
  51. $this->ruleKey = $ruleKey;
  52. }
  53. public function findManyToManyRowset($matchTable, $intersectionTable, $callerRefRule = null,
  54. $matchRefRule = null, Zend_Db_Table_Select $select = null)
  55. {
  56. $this->matchTable = $matchTable;
  57. $this->intersectionTable = $intersectionTable;
  58. $this->callerRefRuleKey = $callerRefRule;
  59. $this->matchRefRuleKey = $matchRefRule;
  60. }
  61. protected function _transformColumn($columnName)
  62. {
  63. // convert 'columnFoo' to 'column_foo'
  64. $columnName = strtolower(preg_replace('/([A-Z])/', '_$1', $columnName));
  65. return $columnName;
  66. }
  67. }