MockModel.php 713 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Lithium: the most rad php framework
  4. *
  5. * @copyright Copyright 2013, Union of RAD (http://union-of-rad.org)
  6. * @license http://opensource.org/licenses/bsd-license.php The BSD License
  7. */
  8. namespace lithium\tests\mocks\data;
  9. use lithium\tests\mocks\data\source\database\adapter\MockAdapter;
  10. class MockModel extends \lithium\data\Model {
  11. public static function __init() {}
  12. public static function &connection($records = null) {
  13. $mock = new MockAdapter(compact('records') + array(
  14. 'columns' => array(
  15. 'lithium\tests\mocks\data\MockModel' => array('id', 'data')
  16. ),
  17. 'autoConnect' => false
  18. ));
  19. static::meta(array('key' => 'id', 'locked' => true));
  20. return $mock;
  21. }
  22. }
  23. ?>