Adhering to CakePHP coding standards

This commit is contained in:
Nick Beeuwsaert 2014-06-27 17:28:43 +00:00
parent f9aa954562
commit 6623a8a7f4

View file

@ -245,20 +245,26 @@ class TestObjectWithoutToString {
* An event listener to test cakePHP events * An event listener to test cakePHP events
*/ */
class TestViewEventListener implements CakeEventListener { class TestViewEventListener implements CakeEventListener {
public $beforeRenderViewType; public $beforeRenderViewType;
public $afterRenderViewType; public $afterRenderViewType;
public function implementedEvents() { public function implementedEvents() {
return array( return array(
"View.beforeRender"=>"beforeRender", 'View.beforeRender' => 'beforeRender',
"View.afterRender" =>"afterRender", 'View.afterRender' => 'afterRender',
); );
} }
public function beforeRender($event) { public function beforeRender($event) {
$this->beforeRenderViewType = $event->subject()->getCurrentType(); $this->beforeRenderViewType = $event->subject()->getCurrentType();
} }
public function afterRender($event) { public function afterRender($event) {
$this->afterRenderViewType = $event->subject()->getCurrentType(); $this->afterRenderViewType = $event->subject()->getCurrentType();
} }
} }
/** /**
* ViewTest class * ViewTest class
@ -835,7 +841,7 @@ class ViewTest extends CakeTestCase {
* *
* @return void * @return void
*/ */
public function testViewEvent(){ public function testViewEvent() {
$View = new View($this->PostsController); $View = new View($this->PostsController);
$View->autoLayout = false; $View->autoLayout = false;
$listener = new TestViewEventListener(); $listener = new TestViewEventListener();