Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12345 anikendra 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
 
16
App::uses('SqlLogPanel', 'DebugKit.Lib/Panel');
17
App::uses('Model', 'Model');
18
App::uses('Controller', 'Controller');
19
 
20
/**
21
 * Class SqlLogPanelTest
22
 *
23
 * @since         DebugKit 2.1
24
 */
25
class SqlLogPanelTest extends CakeTestCase {
26
 
27
/**
28
 * fixtures.
29
 *
30
 * @var array
31
 */
32
	public $fixtures = array('core.article');
33
 
34
/**
35
 * Setup
36
 *
37
 * @return void
38
 */
39
	public function setUp() {
40
		parent::setUp();
41
		$this->panel = new SqlLogPanel();
42
	}
43
 
44
/**
45
 * test the parsing of source list.
46
 *
47
 * @return void
48
 */
49
	public function testBeforeRender() {
50
		$Article = ClassRegistry::init('Article');
51
		$Article->find('first', array('conditions' => array('Article.id' => 1)));
52
 
53
		$controller = new Controller();
54
		$result = $this->panel->beforeRender($controller);
55
 
56
		$this->assertTrue(isset($result['connections'][$Article->useDbConfig]));
57
		$this->assertTrue(isset($result['threshold']));
58
	}
59
}