From 729c5d9876df6b455f9cc37635f49d2919d828d3 Mon Sep 17 00:00:00 2001 From: KUBO Atsuhiro Date: Wed, 5 Sep 2012 12:53:19 +0900 Subject: [PATCH] [PageFlow] Renamed the IPageFlow::getView() method to getCurrentView(). (Issue #4) --- src/Piece/Flow/Continuation/NullPageFlow.php | 2 +- src/Piece/Flow/Continuation/PageFlowInstance.php | 4 ++-- src/Piece/Flow/PageFlow/IPageFlow.php | 2 +- src/Piece/Flow/PageFlow/PageFlow.php | 2 +- test/Piece/Flow/PageFlow/PageFlowTest.php | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Piece/Flow/Continuation/NullPageFlow.php b/src/Piece/Flow/Continuation/NullPageFlow.php index 902e210..570aeec 100644 --- a/src/Piece/Flow/Continuation/NullPageFlow.php +++ b/src/Piece/Flow/Continuation/NullPageFlow.php @@ -87,7 +87,7 @@ public function getPreviousState() return null; } - public function getView() + public function getCurrentView() { return null; } diff --git a/src/Piece/Flow/Continuation/PageFlowInstance.php b/src/Piece/Flow/Continuation/PageFlowInstance.php index 6aa8bb0..ca929b5 100644 --- a/src/Piece/Flow/Continuation/PageFlowInstance.php +++ b/src/Piece/Flow/Continuation/PageFlowInstance.php @@ -127,9 +127,9 @@ public function getPreviousState() return $this->pageFlow->getPreviousState(); } - public function getView() + public function getCurrentView() { - return $this->pageFlow->getView(); + return $this->pageFlow->getCurrentView(); } public function isInFinalState() diff --git a/src/Piece/Flow/PageFlow/IPageFlow.php b/src/Piece/Flow/PageFlow/IPageFlow.php index 4ba5d55..31663dd 100644 --- a/src/Piece/Flow/PageFlow/IPageFlow.php +++ b/src/Piece/Flow/PageFlow/IPageFlow.php @@ -85,7 +85,7 @@ public function getPreviousState(); * @return string * @throws \Piece\Flow\PageFlow\IncompleteTransitionException */ - public function getView(); + public function getCurrentView(); /** * Checks whether the current state is the final state or not. diff --git a/src/Piece/Flow/PageFlow/PageFlow.php b/src/Piece/Flow/PageFlow/PageFlow.php index 2cdf7b6..af7e222 100644 --- a/src/Piece/Flow/PageFlow/PageFlow.php +++ b/src/Piece/Flow/PageFlow/PageFlow.php @@ -156,7 +156,7 @@ public function setActionInvoker(ActionInvoker $actionInvoker) $this->actionInvoker = $actionInvoker; } - public function getView() + public function getCurrentView() { if (!$this->isActive()) return null; diff --git a/test/Piece/Flow/PageFlow/PageFlowTest.php b/test/Piece/Flow/PageFlow/PageFlowTest.php index 23192ed..3409e4c 100644 --- a/test/Piece/Flow/PageFlow/PageFlowTest.php +++ b/test/Piece/Flow/PageFlow/PageFlowTest.php @@ -72,7 +72,7 @@ public function testGettingView() $flow->setActionInvoker(\Phake::mock('Piece\Flow\PageFlow\ActionInvoker')); $flow->start(); - $this->assertEquals('Form', $flow->getView()); + $this->assertEquals('Form', $flow->getCurrentView()); } public function testGettingPreviousStateName() @@ -185,7 +185,7 @@ public function testOptionalElements() $flow->setPayload(new \stdClass()); $flow->start(); - $this->assertEquals('foo', $flow->getView()); + $this->assertEquals('foo', $flow->getCurrentView()); } public function testInitialAndFinalActionsWithYAML() @@ -203,7 +203,7 @@ public function testInvalidTransition() $flow->setPayload(new \stdClass()); $flow->start(); $flow->triggerEvent('go'); - $flow->getView(); + $flow->getCurrentView(); } public function testCheckingWhetherCurrentStateIsFinalState() @@ -377,13 +377,13 @@ protected function assertInitialAndFinalActions($source) $flow->setPayload(new \stdClass()); $flow->start(); - $this->assertEquals('start', $flow->getView()); + $this->assertEquals('start', $flow->getCurrentView()); \Phake::verify($actionInvoker)->invoke('initialize', $this->anything()); \Phake::verify($actionInvoker, \Phake::times(0))->invoke('finalize', $this->anything()); $flow->triggerEvent('go'); - $this->assertEquals('end', $flow->getView()); + $this->assertEquals('end', $flow->getCurrentView()); \Phake::verify($actionInvoker)->invoke('finalize', $this->anything()); try {