Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: UnionOfRAD/lithium
...
head fork: UnionOfRAD/lithium
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 2 contributors
View
2  test/Controller.php
@@ -37,7 +37,7 @@ public function __invoke($request, $dispatchParams, array $options = array()) {
return $this->_filter(__METHOD__, $params, function($self, $params) {
$request = $params['request'];
- $options = $params['options'];
+ $options = $params['options'] + compact('request');
$params = $params['dispatchParams'];
set_time_limit((integer) $options['timeout']);
$group = join('\\', (array) $params['args']);
View
31 test/Report.php
@@ -100,6 +100,15 @@ class Report extends \lithium\core\Object {
protected $_filters = array();
/**
+ * Class dependencies.
+ *
+ * @var array
+ */
+ protected $_classes = array(
+ 'view' => 'lithium\template\View'
+ );
+
+ /**
* Construct Report Object
*
* @param array $config Options array for the test run. Valid options are:
@@ -216,21 +225,25 @@ function($value) { return is_array($value) ? count($value) : $value; }, $stats
* @filter
*/
public function render($template, $data = array()) {
- $config = $this->_config;
+ $config = $this->_config + array(
+ 'paths' => array(
+ 'template' => '{:library}/test/templates/{:type}/{:template}.{:type}.php',
+ 'layout' => '{:library}/test/templates/{:type}/layout.{:type}.php',
+ 'element' => '{:library}/test/templates/{:type}/{:template}.{:type}.php'
+ )
+ );
- if ($template == "stats" && !$data) {
+ if ($template == 'stats' && !$data) {
$data = $this->stats();
}
- $template = Libraries::locate("test.templates.{$config['reporter']}", $template, array(
- 'filter' => false, 'type' => 'file', 'suffix' => ".{$config['format']}.php"
- ));
$params = compact('template', 'data', 'config');
return $this->_filter(__METHOD__, $params, function($self, $params, $chain) {
- extract($params['data']);
- ob_start();
- include $params['template'];
- return ob_get_clean();
+ $view = $self->invokeMethod('_instance', array('view', $params['config']));
+ return $view->render('all', $params['data'], array(
+ 'template' => $params['template'],
+ 'library' => 'lithium'
+ ));
});
}
View
4 test/templates/html/layout.html.php
@@ -35,12 +35,12 @@
<div class="article">
<article>
<div class="test-menu">
- <?php echo $report->render("menu", array("menu" => $menu, "base" => $base)) ?>
+ <?=$this->_render('element', "menu", compact("menu", "base")); ?>
</div>
<div class="test-content">
<?php if ($report->title) { ?>
- <h2><span>test results for </span><?php echo $report->title; ?></h2>
+ <h2><span>test results for </span><?=$report->title; ?></h2>
<?php } ?>
<span class="filters">

No commit comments for this range

Something went wrong with that request. Please try again.