Base for a static organization website

SqlLogPanelTest.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * SqlLogPanelTest
  4. *
  5. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  6. *
  7. * Licensed under The MIT License
  8. * Redistributions of files must retain the above copyright notice.
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  11. * @link http://cakephp.org CakePHP(tm) Project
  12. * @since DebugKit 2.1
  13. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  14. */
  15. App::uses('SqlLogPanel', 'DebugKit.Lib/Panel');
  16. App::uses('Model', 'Model');
  17. App::uses('Controller', 'Controller');
  18. /**
  19. * Class SqlLogPanelTest
  20. *
  21. * @since DebugKit 2.1
  22. */
  23. class SqlLogPanelTest extends CakeTestCase {
  24. /**
  25. * fixtures.
  26. *
  27. * @var array
  28. */
  29. public $fixtures = array('core.article');
  30. /**
  31. * Setup
  32. *
  33. * @return void
  34. */
  35. public function setUp() {
  36. parent::setUp();
  37. $this->panel = new SqlLogPanel();
  38. }
  39. /**
  40. * test the parsing of source list.
  41. *
  42. * @return void
  43. */
  44. public function testBeforeRender() {
  45. $Article = ClassRegistry::init('Article');
  46. $Article->find('first', array('conditions' => array('Article.id' => 1)));
  47. $controller = new Controller();
  48. $result = $this->panel->beforeRender($controller);
  49. $this->assertTrue(isset($result['connections'][$Article->useDbConfig]));
  50. $this->assertTrue(isset($result['threshold']));
  51. }
  52. }