Skip to content

Commit

Permalink
[PageFlow] Renamed the IPageFlow::getView() method to getCurrentView(…
Browse files Browse the repository at this point in the history
…). (Issue piece#4)
  • Loading branch information
iteman committed Sep 18, 2012
1 parent e26f7d8 commit badce5c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Piece/Flow/Continuation/NullPageFlow.php
Expand Up @@ -87,7 +87,7 @@ public function getPreviousState()
return null;
}

public function getView()
public function getCurrentView()
{
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Piece/Flow/Continuation/PageFlowInstance.php
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/Piece/Flow/PageFlow/IPageFlow.php
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/Piece/Flow/PageFlow/PageFlow.php
Expand Up @@ -156,7 +156,7 @@ public function setActionInvoker(ActionInvoker $actionInvoker)
$this->actionInvoker = $actionInvoker;
}

public function getView()
public function getCurrentView()
{
if (!$this->isActive()) return null;

Expand Down
10 changes: 5 additions & 5 deletions test/Piece/Flow/PageFlow/PageFlowTest.php
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -203,7 +203,7 @@ public function testInvalidTransition()
$flow->setPayload(new \stdClass());
$flow->start();
$flow->triggerEvent('go');
$flow->getView();
$flow->getCurrentView();
}

public function testCheckingWhetherCurrentStateIsFinalState()
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit badce5c

Please sign in to comment.