initial commit

This commit is contained in:
2026-06-25 13:03:45 +06:00
commit 4589f4a8d0
3229 changed files with 941958 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
<?php
/**
* DebugKit Log Panel Test Cases
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @license http://www.opensource.org/licenses/mit-license.php MIT License
**/
App::uses('LogPanel', 'DebugKit.Lib/Panel');
App::uses('Controller', 'Controller');
/**
* Class LogPanelTest
*
*/
class LogPanelTest extends CakeTestCase {
/**
* set up
*
* @return void
*/
public function setUp() {
parent::setUp();
$this->panel = new LogPanel();
}
/**
* Test that logging configs are created.
*
* @return void
*/
public function testConstructor() {
$result = CakeLog::configured();
$this->assertContains('debug_kit_log_panel', $result);
$this->assertTrue(count($result) > 1, 'Default loggers were not added.');
}
/**
* testBeforeRender
*
* @return void
*/
public function testBeforeRender() {
$controller = new Controller();
CakeLog::write('error', 'Test');
$result = $this->panel->beforeRender($controller);
$this->assertInstanceOf('DebugKitLog', $result);
$this->assertTrue(isset($result->logs));
$this->assertCount(1, $result->logs['error']);
}
}

View File

@@ -0,0 +1,59 @@
<?php
/**
* SqlLogPanelTest
*
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since DebugKit 2.1
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
App::uses('SqlLogPanel', 'DebugKit.Lib/Panel');
App::uses('Model', 'Model');
App::uses('Controller', 'Controller');
/**
* Class SqlLogPanelTest
*
* @since DebugKit 2.1
*/
class SqlLogPanelTest extends CakeTestCase {
/**
* fixtures.
*
* @var array
*/
public $fixtures = array('core.article');
/**
* Setup
*
* @return void
*/
public function setUp() {
parent::setUp();
$this->panel = new SqlLogPanel();
}
/**
* test the parsing of source list.
*
* @return void
*/
public function testBeforeRender() {
$Article = ClassRegistry::init('Article');
$Article->find('first', array('conditions' => array('Article.id' => 1)));
$controller = new Controller();
$result = $this->panel->beforeRender($controller);
$this->assertTrue(isset($result['connections'][$Article->useDbConfig]));
$this->assertTrue(isset($result['threshold']));
}
}