diff --git a/src/Event/Event.php b/src/Event/Event.php index 9bf40cfff75..b2921c823eb 100644 --- a/src/Event/Event.php +++ b/src/Event/Event.php @@ -53,7 +53,7 @@ class Event * * @var mixed */ - protected $_result = null; + public $result = null; /** * Flags an event as stopped or not, default is false @@ -99,7 +99,7 @@ public function __get($attribute) return $this->_data; } if ($attribute === 'result') { - return $this->_result; + return $this->result; } } @@ -117,7 +117,7 @@ public function __set($attribute, $value) $this->_data = (array)$value; } if ($attribute === 'result') { - $this->_result = $value; + $this->result = $value; } } @@ -191,7 +191,7 @@ public function isStopped() */ public function result() { - return $this->_result; + return $this->result; } /** @@ -201,7 +201,7 @@ public function result() */ public function getResult() { - return $this->_result; + return $this->result; } /** @@ -212,7 +212,7 @@ public function getResult() */ public function setResult($value = null) { - $this->_result = $value; + $this->result = $value; return $this; } diff --git a/tests/TestCase/Event/EventManagerTest.php b/tests/TestCase/Event/EventManagerTest.php index 7120997dd91..a1ab38074f7 100644 --- a/tests/TestCase/Event/EventManagerTest.php +++ b/tests/TestCase/Event/EventManagerTest.php @@ -422,6 +422,7 @@ public function testDispatchReturnValue() ->with($event); $manager->dispatch($event); $this->assertEquals('something special', $event->result()); + $this->assertEquals('something special', $event->result); } /**