Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
6b48868
Merge pull request #2 from ProLoser/master
bancer Nov 24, 2016
a29f3ff
updated gitignore
bancer Nov 24, 2016
54c2aad
Merge pull request #3 from bancer/master
bancer Nov 24, 2016
d014094
updated gitignore and composer
bancer Nov 24, 2016
f93ea88
improved WizardHelper code style
bancer Nov 24, 2016
13a5348
fixed WizardComponent code style
bancer Nov 24, 2016
be67f02
added .travis.yml and a test file
bancer Nov 26, 2016
99f4c1e
improved travis config, removed wrong import
bancer Nov 26, 2016
f3a0d99
added phpcs to travis config
bancer Nov 26, 2016
cff20b8
improved travis config
bancer Nov 26, 2016
4552703
fixed travis phpcs path
bancer Nov 26, 2016
46a9270
improved documentation
bancer Nov 26, 2016
155c873
fixed code style
bancer Nov 26, 2016
3bbfc50
Merge pull request #4 from bancer/2.x
bancer Nov 26, 2016
f6347e8
improved unit test
bancer Nov 26, 2016
b226f87
fixed testInitialize()
bancer Nov 26, 2016
10fc359
fixed unit tests, added code coverage
bancer Nov 26, 2016
080f10f
adjusted coverage config
bancer Nov 26, 2016
05218fc
temporary commented out unused test code
bancer Nov 26, 2016
e77fa06
Merge pull request #5 from bancer/2.x
bancer Nov 26, 2016
4d5e62d
added unit test, adjusted coverage config
bancer Nov 26, 2016
a9dcec6
adjusted unit tests
bancer Nov 26, 2016
fc57720
adjusted coverage config
bancer Nov 26, 2016
132a859
adjusted coverage config
bancer Nov 26, 2016
41817dd
adjusted coverage config
bancer Nov 26, 2016
a84eb1f
adjusted coverage config
bancer Nov 26, 2016
9b5d797
adjusted coverage config
bancer Nov 26, 2016
e762c33
adjusted coverage config
bancer Nov 26, 2016
906c02d
adjusted coverage configuration
bancer Nov 26, 2016
4ff54e8
adjusted coverage configuration
bancer Nov 26, 2016
839853e
Merge pull request #6 from bancer/2.x
bancer Nov 26, 2016
7eb0b08
improved unit test
bancer Nov 26, 2016
9e15878
improved documentation and code style, more unit testing
bancer Nov 27, 2016
5526bb6
fixed typo
bancer Nov 27, 2016
159d3c2
fixed undefined variable
bancer Nov 27, 2016
d427689
fixed unit test
bancer Nov 27, 2016
2f98656
branch() method simplified and unit tested
bancer Nov 27, 2016
747ed88
improved code style
bancer Nov 27, 2016
f945125
Merge pull request #7 from bancer/2.x
bancer Nov 27, 2016
6b906c4
more unit tests
bancer Nov 27, 2016
9ace9e4
more unit tests
bancer Nov 27, 2016
d0f6b0d
fixed unit test
bancer Nov 27, 2016
b44d9a4
fixed unit test
bancer Nov 27, 2016
e22944a
fixed unit test
bancer Nov 27, 2016
8a581e7
adjusted codecov.io call
bancer Nov 27, 2016
0ff7b68
adjusted codecov call
bancer Nov 27, 2016
d188a9f
improved unit test
bancer Nov 27, 2016
c4195f4
improved unit test
bancer Nov 27, 2016
0b113fe
more unit tests
bancer Nov 27, 2016
704de0b
fixed unit test
bancer Nov 27, 2016
c343f49
more unit tests
bancer Nov 27, 2016
1e39bd4
Merge pull request #8 from bancer/2.x
bancer Nov 27, 2016
fd8ead6
improved unit tests
bancer Nov 27, 2016
037c075
improved unit tests
bancer Nov 27, 2016
cc82e84
fixed unit tests
bancer Nov 27, 2016
b8903a5
improved unit tests
bancer Nov 27, 2016
a178da9
improved unit tests
bancer Nov 27, 2016
0ad5e7a
improved unit tests
bancer Nov 27, 2016
1f4595e
simplified unit tests
bancer Nov 27, 2016
2e347be
improved unit tests
bancer Nov 27, 2016
04dbd50
temporary comment out yet unused code
bancer Nov 27, 2016
3a64693
Merge pull request #9 from bancer/2.x
bancer Nov 27, 2016
1de3117
more unit tests
bancer Nov 30, 2016
291c62e
improved code style and unit tests
bancer Nov 30, 2016
62b07fa
improved unit test
bancer Nov 30, 2016
e259475
fixed unit test
bancer Nov 30, 2016
72c2ee6
improved code style, unit tests
bancer Nov 30, 2016
2312872
fixed unit test
bancer Nov 30, 2016
6fc4b55
fixed $this->controller->data, improved unit tests
bancer Nov 30, 2016
107e52a
fixed unit test
bancer Nov 30, 2016
203ef6b
improved unit test
bancer Nov 30, 2016
84602d1
unit tests
bancer Nov 30, 2016
9990162
unit tests
bancer Nov 30, 2016
2d36b2b
more debug
bancer Nov 30, 2016
6e57d25
unit tests
bancer Nov 30, 2016
37da4c6
unit tests
bancer Nov 30, 2016
4ea8052
more debug
bancer Nov 30, 2016
acf6f66
more debug
bancer Nov 30, 2016
970912e
more debug
bancer Nov 30, 2016
83f1c21
more debug
bancer Nov 30, 2016
9ba911e
unit tests
bancer Nov 30, 2016
60477ac
unit tests
bancer Nov 30, 2016
ec581e4
unit tests
bancer Nov 30, 2016
1a386fd
unit tests
bancer Nov 30, 2016
ed0ff50
unit tests
bancer Nov 30, 2016
3031659
unit tests
bancer Nov 30, 2016
327e842
unit tests
bancer Nov 30, 2016
d891861
unit tests
bancer Nov 30, 2016
9b13e6a
unit tests
bancer Nov 30, 2016
42a5400
code style, unit tests
bancer Nov 30, 2016
9b5e05b
fixed unit tests
bancer Nov 30, 2016
0cf33dc
more unit tests
bancer Nov 30, 2016
27bf6c0
added missing import
bancer Nov 30, 2016
57013b3
unit tests
bancer Nov 30, 2016
5e2afb1
unit tests
bancer Nov 30, 2016
a95c233
unit tests
bancer Nov 30, 2016
0faa981
unit tests
bancer Nov 30, 2016
acdac79
unit tests
bancer Nov 30, 2016
5ad4cba
unit tests
bancer Nov 30, 2016
7dd959e
more unit tests
bancer Nov 30, 2016
910e0e6
unit tests
bancer Nov 30, 2016
8a55c1d
unit tests
bancer Nov 30, 2016
86934eb
unit tests
bancer Nov 30, 2016
c8765dc
unit tests
bancer Nov 30, 2016
0ca7055
unit tests
bancer Nov 30, 2016
bac36f0
unit tests
bancer Nov 30, 2016
6bbf5bc
unit tests
bancer Nov 30, 2016
0f97919
unit tests
bancer Nov 30, 2016
a354337
reenable stylecheck
bancer Nov 30, 2016
0ad35f1
fixed code style
bancer Nov 30, 2016
66ce408
Merge pull request #10 from bancer/2.x
bancer Nov 30, 2016
215c999
Merge pull request #11 from bancer/master
bancer Nov 30, 2016
64eb288
Merge pull request #12 from bancer/2.x
bancer Nov 30, 2016
36227bb
Merge branch 'master' of https://github.com/ProLoser/CakePHP-Wizard into
bancer Nov 30, 2016
5dede2b
Merge pull request #14 from bancer/ProLoser-master
bancer Nov 30, 2016
d68af58
Merge pull request #15 from bancer/2.x
bancer Nov 30, 2016
007f8d8
more unit tests
bancer Dec 1, 2016
752c363
fixed code style
bancer Dec 1, 2016
c665854
unit tests
bancer Dec 1, 2016
b9638e1
unit tests
bancer Dec 1, 2016
1ab4e5a
unit tests
bancer Dec 1, 2016
36a4781
unit tests
bancer Dec 1, 2016
7ea1a2f
unit tests
bancer Dec 1, 2016
a903f5f
unit tests
bancer Dec 1, 2016
f30148f
unit tests
bancer Dec 1, 2016
01c9f42
unit tests
bancer Dec 1, 2016
56cb7c1
unit tests
bancer Dec 1, 2016
5a80f68
unit tests
bancer Dec 1, 2016
f468264
unit tests
bancer Dec 1, 2016
34be65e
Merge pull request #16 from bancer/2.x
bancer Dec 1, 2016
4902008
Merge branch 'master' of https://github.com/ProLoser/CakePHP-Wizard into
bancer Dec 1, 2016
7619304
adjusted travis config
bancer Dec 1, 2016
a52cbf9
Merge pull request #18 from bancer/ProLoser-master
bancer Dec 1, 2016
4371a54
Merge pull request #19 from bancer/2.x
bancer Dec 1, 2016
efeaef5
Progress menu links made consistent
bancer Dec 2, 2016
c0ac9b5
humanized steps in the helper
bancer Dec 2, 2016
bf4aadd
Merge pull request #20 from bancer/2.x
bancer Dec 2, 2016
0133f75
Merge branch 'master' of https://github.com/ProLoser/CakePHP-Wizard into
bancer Dec 2, 2016
eab7e84
Merge pull request #21 from bancer/2.x
bancer Dec 2, 2016
bb3d45f
improved redirect link
bancer Dec 2, 2016
1f1f0b4
Merge pull request #22 from bancer/2.x
bancer Dec 2, 2016
304f37f
improved redirect link
bancer Dec 2, 2016
ba9db08
Merge pull request #23 from bancer/2.x
bancer Dec 2, 2016
f3c381f
persist url params on redirect
bancer Jan 18, 2017
4319ab5
Merge branch 'master' of https://github.com/ProLoser/CakePHP-Wizard into
bancer Jan 18, 2017
87beb9a
added debug
bancer Jan 18, 2017
01766fe
more debug
bancer Jan 18, 2017
010e3fe
removed debug
bancer Jan 18, 2017
bc495cd
adjusted url in the unit test
bancer Jan 18, 2017
eedc242
more debug
bancer Jan 18, 2017
52e15e0
fixed url parsing in unit test
bancer Jan 18, 2017
f663f27
removed debug
bancer Jan 18, 2017
c7d3ccb
support persistUrlParams in the WizardHelper
bancer Jan 18, 2017
2038bf9
improved persist url params logic
bancer Jan 18, 2017
4fcaa0d
mode debug
bancer Jan 18, 2017
91ee393
minor improvement
bancer Jan 18, 2017
fe0fc45
fixed passed param in the url
bancer Jan 18, 2017
bfc0cd3
removed debug, fixed unit tests
bancer Jan 18, 2017
5d63637
Merge pull request #24 from bancer/2.x
bancer Jan 18, 2017
c9b5377
Wizard root session key is refactored to a configurable component
bancer Feb 20, 2017
ba1f42d
fixed unit test
bancer Feb 20, 2017
33ec312
Merge pull request #25 from bancer/improved-session
bancer Feb 20, 2017
5e9b6e7
Moved sessionRootKey related code from initialize to startup to ease the
bancer Feb 21, 2017
3e1f70d
Setting session keys refactored to a private method.
bancer Feb 21, 2017
f3c2595
Fixed variable name.
bancer Feb 21, 2017
78f30ed
Merge pull request #26 from bancer/improved-session
bancer Feb 21, 2017
96b2409
Merge pull request #27 from bancer/2.x
bancer Feb 21, 2017
faf6af1
#more unit tests
bancer Mar 8, 2017
9b7c204
adjusted unit tests
bancer Mar 8, 2017
15ca341
better clear session in tests
bancer Mar 8, 2017
e1966d7
unit tests adjusted
bancer Mar 8, 2017
c21d679
unit tests
bancer Mar 8, 2017
e65b739
unit tests improved
bancer Mar 8, 2017
9fdef2e
Some refactoring in order to reduce the number of redirects
bancer Mar 8, 2017
0fb4e4e
more refactoring
bancer Mar 8, 2017
cebb126
more docs and reset the expected step in branch()
bancer Mar 8, 2017
29e05ca
updates expected step after save() and updates steps after unbranch() is
bancer Mar 8, 2017
d36fea2
ensure the current step is set properly
bancer Mar 8, 2017
23d5ff1
Merge branch '2.x' of https://github.com/bancer/cakephp-wizard into
bancer Mar 8, 2017
da08c42
Merge pull request #29 from bancer/redirects-optimization-conflicts
bancer Mar 8, 2017
25760e9
Merge branch 'master' of https://github.com/ProLoser/CakePHP-Wizard i…
bancer Mar 8, 2017
ab2efeb
Merge pull request #30 from bancer/redirects-optimization-conflicts
bancer Mar 8, 2017
58f7f6a
Merge branch 'master' of https://github.com/ProLoser/CakePHP-Wizard into
bancer Mar 8, 2017
358b876
Merge pull request #31 from bancer/redirects-optimization
bancer Mar 8, 2017
f5239cd
Merge pull request #32 from bancer/2.x
bancer Mar 8, 2017
b348094
Fixed indefinite loop bug.
bancer Mar 9, 2017
44d04d1
Merge pull request #33 from bancer/redirects-optimization
bancer Mar 9, 2017
ac03bbc
Merge pull request #34 from bancer/2.x
bancer Mar 9, 2017
4107309
Merge branch 'master' of https://github.com/ProLoser/CakePHP-Wizard
bancer Jun 2, 2017
2a92cb9
used Router::reverseToArray()
bancer Jun 2, 2017
8d2808d
updated cakephp version
bancer Jun 2, 2017
d2eddd3
restored deleted params
bancer Jun 2, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ php:

env:
# - CAKE_VERSION=2.8.0 DB=mysql
- CAKE_VERSION=2.9.2 DB=mysql
- CAKE_VERSION=2.9.9 DB=mysql

install:
- git clone git://github.com/cakephp/cakephp ../cakephp && cd ../cakephp && git checkout $CAKE_VERSION
Expand Down
54 changes: 47 additions & 7 deletions Controller/Component/WizardComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ class WizardComponent extends Component {
*/
public $draftUrl = '/';

/**
* If `true` then URL parameters from the first step will be present in the URLs
* of all other steps.
*
* @var bool
*/
public $persistUrlParams = false;

/**
* If true, the first "non-skipped" branch in a group will be used if a branch has
* not been included specifically.
Expand Down Expand Up @@ -205,6 +213,13 @@ class WizardComponent extends Component {
*/
protected $_wizardUrl = array();

/**
* Holds the array with steps and branches from the initial Wizard configuration.
*
* @var array
*/
protected $_stepsAndBranches = array();

/**
* Initializes WizardComponent for use in the controller
*
Expand All @@ -216,6 +231,7 @@ class WizardComponent extends Component {
public function initialize(Controller $controller) {
$this->controller = $controller;
$this->__setSessionKeys();
$this->_stepsAndBranches = $this->steps;
}

/**
Expand Down Expand Up @@ -244,16 +260,27 @@ private function __setSessionKeys() {
*/
public function startup(Controller $controller) {
$this->__setSessionKeys();
$this->steps = $this->_parseSteps($this->steps);
$this->config('action', $this->action);
$this->config('steps', $this->steps);
$this->_configSteps($this->steps);
if (!in_array('Wizard.Wizard', $this->controller->helpers) && !array_key_exists('Wizard.Wizard', $this->controller->helpers)) {
$this->controller->helpers['Wizard.Wizard'] = array(
'sessionRootKey' => $this->sessionRootKey,
);
}
}

/**
* Parses the steps array by stripping off nested arrays not included in the branches
* and writes a simple array with the correct steps to session.
*
* @param array $steps Array to be parsed for nested arrays.
* @return void
*/
protected function _configSteps($steps) {
$this->steps = $this->_parseSteps($steps);
$this->config('steps', $this->steps);
}

/**
* Parses the steps array by stripping off nested arrays not included in the branches
* and returns a simple array with the correct steps.
Expand Down Expand Up @@ -513,6 +540,9 @@ protected function _validStep($step) {
* @return void
*/
protected function _setCurrentStep($step) {
if (!in_array($step, $this->steps)) {
return;
}
$this->_currentStep = reset($this->steps);
while (current($this->steps) != $step) {
$this->_currentStep = next($this->steps);
Expand Down Expand Up @@ -559,6 +589,8 @@ public function save($step = null, $data = null) {
$data = $this->controller->request->data;
}
$this->controller->Session->write("$this->_sessionKey.$step", $data);
$this->_getExpectedStep();
$this->_setCurrentStep($step);
}

/**
Expand All @@ -576,11 +608,17 @@ public function redirect($step = null, $status = null, $exit = true) {
if ($step == null) {
$step = $this->_getExpectedStep();
}
$url = array(
'controller' => Inflector::underscore($this->controller->name),
'action' => $this->action,
$step
);
if ($this->persistUrlParams) {
$url = Router::reverseToArray($this->controller->request);
$url['action'] = $this->action;
$url[0] = $step;
} else {
$url = array(
'controller' => Inflector::underscore($this->controller->name),
'action' => $this->action,
$step,
);
}
return $this->controller->redirect($url, $status, $exit);
}

Expand All @@ -606,6 +644,7 @@ public function branch($name, $skip = false) {
}
$branches[$name] = $value;
$this->controller->Session->write($this->_branchKey, $branches);
$this->_configSteps($this->_stepsAndBranches);
}

/**
Expand Down Expand Up @@ -677,6 +716,7 @@ public function delete($key = null) {
*/
public function unbranch($branch) {
$this->controller->Session->delete("$this->_branchKey.$branch");
$this->_configSteps($this->_stepsAndBranches);
}

}
156 changes: 155 additions & 1 deletion Test/Case/Controller/Component/WizardComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class WizardUserMock extends Model {
/**
* AuthTestController class
*
* @property WizardComponent $Wizard
* @package Wizard.Test.Case.Controller.Component
*/
class WizardTestController extends Controller {
Expand Down Expand Up @@ -71,6 +72,22 @@ public function processStep2() {
return false;
}

public function processGender() {
if (!empty($this->request->data)) {
if ($this->Wizard->defaultBranch === false) {
if ($this->request->data['WizardUserMock']['gender'] == 'female') {
$this->Wizard->unbranch('male');
$this->Wizard->branch('female');
} else {
$this->Wizard->unbranch('female');
$this->Wizard->branch('male');
}
}
return true;
}
return false;
}

public function processStep3() {
if (!empty($this->request->data)) {
return true;
Expand Down Expand Up @@ -136,7 +153,7 @@ public function setUp() {
*/
public function tearDown() {
parent::tearDown();
$this->Wizard->Session->delete('Wizard');
CakeSession::destroy();
unset($this->Controller, $this->Wizard);
}

Expand Down Expand Up @@ -374,6 +391,87 @@ public function testProcessStepOnePost() {
$this->assertEquals($expectedSession, $resultSession);
}

/**
* Tests 'autoAdvance' and 'defaultBranch' settings set to false and manual call to `branch()`.
*
* @return void
*/
public function testProcessGenderPost() {
$this->Wizard->Session->delete('Wizard');
unset($this->Controller, $this->Wizard);
$CakeRequest = new CakeRequest(null, false);
$CakeResponse = $this->getMock('CakeResponse', array('send'));
$this->Controller = new WizardTestController($CakeRequest, $CakeResponse);
$this->Controller->components['Wizard.Wizard']['autoAdvance'] = false;
$this->Controller->components['Wizard.Wizard']['defaultBranch'] = false;
$ComponentCollection = new ComponentCollection();
$ComponentCollection->init($this->Controller);
$this->Controller->Components->init($this->Controller);
$this->Wizard = $this->Controller->Wizard;
$this->Wizard->initialize($this->Controller);

// Set session prerequisites.
$session = array(
'config' => array(
'steps' => array(
'step1',
'step2',
'gender',
'confirmation',
),
'action' => 'wizard',
'expectedStep' => 'gender',
'activeStep' => 'gender',
),
'WizardTest' => array(
'step1' => array(),
'step2' => array(),
),
);
$this->Wizard->Session->write('Wizard', $session);

$this->Wizard->startup($this->Controller);
$postData = array(
'WizardUserMock' => array(
'gender' => 'female',
),
);
$this->Wizard->controller->request->data = $postData;
$CakeResponse = $this->Wizard->process('gender');

$expectedSession = array(
'branches' => array(
'WizardTest' => array(
'female' => 'branch',
),
),
'config' => array(
'steps' => array(
'step1',
'step2',
'gender',
'step4',
'step5',
'confirmation',
),
'action' => 'wizard',
'expectedStep' => 'step4',
'activeStep' => 'gender',
),
'WizardTest' => array(
'step1' => array(),
'step2' => array(),
'gender' => $postData,
),
);
$resultSession = $this->Wizard->Session->read('Wizard');
$this->assertEquals($expectedSession, $resultSession);

$this->assertInstanceOf('CakeResponse', $CakeResponse);
$headers = $CakeResponse->header();
$this->assertContains('/wizard/step4', $headers['Location']);
}

public function testProcessAutovalidatePost() {
// Set session prerequisites.
$session = array(
Expand Down Expand Up @@ -553,4 +651,60 @@ public function testProcessAfterComplete() {
$resultSession = $this->Wizard->Session->read('Wizard');
$this->assertEquals($expectedSession, $resultSession);
}

public function testRedirectPersistUrlParams() {
$session = $this->Wizard->Session->read('Wizard');
$this->assertEmpty($session);

$url = '/wizard_test/wizard/step1/123/key:value?x=7&y=9';
$CakeRequest = new CakeRequest($url, true);
$CakeRequest->addParams(Router::parse($url));
$CakeResponse = $this->getMock('CakeResponse', array('send'));
$this->Controller = new WizardTestController($CakeRequest, $CakeResponse);
$this->Controller->components['Wizard.Wizard']['persistUrlParams'] = true;
$ComponentCollection = new ComponentCollection();
$ComponentCollection->init($this->Controller);
$this->Controller->Components->init($this->Controller);
$this->Wizard = $this->Controller->Wizard;
$this->Wizard->initialize($this->Controller);

$this->Wizard->startup($this->Controller);
//$this->Wizard->persistUrlParams = true;
// Emulate GET request to set session variables.
$this->Wizard->process('step1');
// Emulate POST request.
$postData = array(
'User' => array(
'username' => 'admin',
'password' => 'pass',
),
);
$this->Wizard->controller->request->data = $postData;
$CakeResponse = $this->Wizard->process('step1');

$this->assertInstanceOf('CakeResponse', $CakeResponse);
$headers = $CakeResponse->header();
$this->assertContains('/wizard_test/wizard/step2/123/key:value?x=7&y=9', $headers['Location']);

$expectedSession = array(
'config' => array(
'steps' => array(
'step1',
'step2',
'gender',
'step3',
'step4',
'confirmation',
),
'action' => 'wizard',
'expectedStep' => 'step2',
'activeStep' => 'step1',
),
'WizardTest' => array(
'step1' => $postData,
),
);
$resultSession = $this->Wizard->Session->read('Wizard');
$this->assertEquals($expectedSession, $resultSession);
}
}
35 changes: 35 additions & 0 deletions Test/Case/View/Helper/WizardHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,39 @@ public function testProgressMenuCustomTitles() {
$result = $this->Wizard->progressMenu($titles);
$this->assertEquals($expected, $result);
}

public function testProgressMenuPersistUrlParams() {
$url = '/wizard_test/wizard/gender/123?x=7&y=9';
$CakeRequest = new CakeRequest($url, true);
$CakeRequest->addParams(Router::parse($url));
$Controller = new Controller($CakeRequest, new CakeResponse());
$View = new View($Controller);
$this->Wizard = new WizardHelper($View);
$session = array(
'config' => array(
'steps' => array(
'step1',
'step2',
'gender',
'step3',
'step4',
'confirmation',
),
'action' => 'wizard',
'expectedStep' => 'gender',
'activeStep' => 'gender',
'persistUrlParams' => true,
),
);
CakeSession::write('Wizard', $session);

$expected = '<div class="complete"><a href="/wizard_test/wizard/step1/123?x=7&amp;y=9">Step1</a></div>';
$expected .= '<div class="complete"><a href="/wizard_test/wizard/step2/123?x=7&amp;y=9">Step2</a></div>';
$expected .= '<div class="expected active"><a href="/wizard_test/wizard/gender/123?x=7&amp;y=9">Gender</a></div>';
$expected .= '<div class="incomplete"><a href="#">Step3</a></div>';
$expected .= '<div class="incomplete"><a href="#">Step4</a></div>';
$expected .= '<div class="incomplete"><a href="#">Confirmation</a></div>';
$result = $this->Wizard->progressMenu();
$this->assertEquals($expected, $result);
}
}
Loading