-
Notifications
You must be signed in to change notification settings - Fork 571
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #421 from cakephp/panel-issue
Fix history loading and sorting issues
- Loading branch information
Showing
6 changed files
with
124 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?php | ||
/** | ||
* 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 | ||
* @since DebugKit 0.1 | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT License | ||
*/ | ||
namespace DebugKit\Test\TestCase\View\Helper; | ||
|
||
use Cake\Core\App; | ||
use Cake\Network\Request; | ||
use Cake\Network\Response; | ||
use Cake\Routing\Router; | ||
use Cake\TestSuite\TestCase; | ||
use Cake\View\View; | ||
use DebugKit\View\Helper\SimpleGraphHelper; | ||
|
||
/** | ||
* Class SimpleGraphHelperTestCase | ||
*/ | ||
class SimpleGraphHelperTest extends TestCase | ||
{ | ||
|
||
/** | ||
* Setup | ||
* | ||
* @return void | ||
*/ | ||
public function setUp() | ||
{ | ||
parent::setUp(); | ||
Router::connect('/:controller/:action'); | ||
|
||
$request = new Request(); | ||
$request->addParams(['controller' => 'pages', 'action' => 'display']); | ||
|
||
$this->View = new View($request); | ||
$this->Graph = new SimpleGraphHelper($this->View); | ||
} | ||
|
||
/** | ||
* Tear Down | ||
* | ||
* @return void | ||
*/ | ||
public function tearDown() | ||
{ | ||
parent::tearDown(); | ||
unset($this->Graph); | ||
} | ||
|
||
/** | ||
* Test bar() | ||
* | ||
* @return void | ||
*/ | ||
public function testBar() | ||
{ | ||
$output = $this->Graph->bar(10, 0); | ||
$expected = [ | ||
['div' => [ | ||
'class' => 'graph-bar', | ||
'style' => 'width: 350px', | ||
]], | ||
['div' => [ | ||
'class' => 'graph-bar-value', | ||
'style' => 'margin-left: 0px; width: 35px', | ||
'title' => 'Starting 0ms into the request, taking 10ms' | ||
]], | ||
' ', | ||
'/div', | ||
'/div' | ||
]; | ||
$this->assertHtml($expected, $output); | ||
} | ||
|
||
/** | ||
* Test bar() with offset | ||
* | ||
* @return void | ||
*/ | ||
public function testBarOffset() | ||
{ | ||
$output = $this->Graph->bar(10, 10); | ||
$expected = [ | ||
['div' => [ | ||
'class' => 'graph-bar', | ||
'style' => 'width: 350px', | ||
]], | ||
['div' => [ | ||
'class' => 'graph-bar-value', | ||
'style' => 'margin-left: 35px; width: 35px', | ||
'title' => 'Starting 10ms into the request, taking 10ms' | ||
]], | ||
' ', | ||
'/div', | ||
'/div' | ||
]; | ||
$this->assertHtml($expected, $output); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters