Skip to content
Permalink
Browse files

More coding standard fixes

  • Loading branch information...
NickBeeuwsaert committed Jun 27, 2014
1 parent 6623a8a commit 733a610bf7425215a869e205096ae2864ccdb844
Showing with 35 additions and 6 deletions.
  1. +33 −4 lib/Cake/Test/Case/View/ViewTest.php
  2. +2 −2 lib/Cake/View/View.php
@@ -239,33 +239,62 @@ public function __toString() {
*/
class TestObjectWithoutToString {
}
/**
* Class TestViewEventListener
*
* An event listener to test cakePHP events
*/
class TestViewEventListener implements CakeEventListener {
/**
* type of view before rendering has occurred
*
* @var string
*/
public $beforeRenderViewType;
/**
* type of view after rendering has occurred
*
* @var string
*/
public $afterRenderViewType;
/**
* implementedEvents method
*
* @return array
*/
public function implementedEvents() {
return array(
'View.beforeRender' => 'beforeRender',
'View.afterRender' => 'afterRender',
);
'View.afterRender' => 'afterRender'
);
}
/**
* beforeRender method
*
* @param CakeEvent $event the event being sent
* @return void
*/
public function beforeRender($event) {
$this->beforeRenderViewType = $event->subject()->getCurrentType();
$this->beforeRenderViewType = $event->subject()->getCurrentType();
}
/**
* afterRender method
*
* @param CakeEvent $event the event being sent
* @return void
*/
public function afterRender($event) {
$this->afterRenderViewType = $event->subject()->getCurrentType();
}
}
/**
* ViewTest class
*
@@ -853,7 +882,7 @@ public function testViewEvent() {
$this->assertEquals(View::TYPE_VIEW, $listener->afterRenderViewType);
$this->assertEquals($View->getCurrentType(), View::TYPE_VIEW);
$View->element('test_element', array(), array("callbacks"=>true));
$View->element('test_element', array(), array('callbacks' => true));
$this->assertEquals($View->getCurrentType(), View::TYPE_VIEW);
$this->assertEquals(View::TYPE_ELEMENT, $listener->beforeRenderViewType);
@@ -814,11 +814,11 @@ public function set($one, $two = null) {
$this->viewVars = $data + $this->viewVars;
}
/**
* Retreived the current view type
* Retrieve the current view type
*
* @return string
*/
public function getCurrentType(){
public function getCurrentType() {
return $this->_currentType;
}
/**

0 comments on commit 733a610

Please sign in to comment.
You can’t perform that action at this time.