-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathFormFlowBcMethodsTest.php
More file actions
109 lines (81 loc) · 3.21 KB
/
Copy pathFormFlowBcMethodsTest.php
File metadata and controls
109 lines (81 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
namespace Craue\FormFlowBundle\Tests\Form;
use Craue\FormFlowBundle\Tests\UnitTestCase;
/**
* Tests for BC.
*
* @group unit
*
* @author Christian Raue <christian.raue@gmail.com>
* @copyright 2011-2015 Christian Raue
* @license http://opensource.org/licenses/mit-license.php MIT License
*/
class FormFlowBcMethodsTest extends UnitTestCase {
protected $collectDeprecationNotices = true;
private $deprecatedMessage = 'Method Craue\FormFlowBundle\Form\FormFlow::%s is deprecated since version 2.0. Use method %s instead.';
public function testBcMethodDelegation_getCurrentStep() {
$flow = $this->getFlowWithMockedMethods(array('getName', 'getCurrentStepNumber'));
$flow
->expects($this->once())
->method('getCurrentStepNumber')
;
$flow->getCurrentStep();
$this->assertEquals(array(sprintf($this->deprecatedMessage, 'getCurrentStep', 'getCurrentStepNumber')), $this->getDeprecationNotices());
}
public function testBcMethodDelegation_getCurrentStepDescription() {
$flow = $this->getFlowWithMockedMethods(array('getName', 'getCurrentStepLabel'));
$flow
->expects($this->once())
->method('getCurrentStepLabel')
;
$flow->getCurrentStepDescription();
$this->assertEquals(array(sprintf($this->deprecatedMessage, 'getCurrentStepDescription', 'getCurrentStepLabel')), $this->getDeprecationNotices());
}
public function testBcMethodDelegation_getMaxSteps() {
$flow = $this->getFlowWithMockedMethods(array('getName', 'getStepCount'));
$flow
->expects($this->once())
->method('getStepCount')
;
$flow->getMaxSteps();
$this->assertEquals(array(sprintf($this->deprecatedMessage, 'getMaxSteps', 'getStepCount')), $this->getDeprecationNotices());
}
public function testBcMethodDelegation_getStepDescriptions() {
$flow = $this->getFlowWithMockedMethods(array('getName', 'getStepLabels'));
$flow
->expects($this->once())
->method('getStepLabels')
;
$flow->getStepDescriptions();
$this->assertEquals(array(sprintf($this->deprecatedMessage, 'getStepDescriptions', 'getStepLabels')), $this->getDeprecationNotices());
}
public function testBcMethodDelegation_getFirstStep() {
$flow = $this->getFlowWithMockedMethods(array('getName', 'getFirstStepNumber'));
$flow
->expects($this->once())
->method('getFirstStepNumber')
;
$flow->getFirstStep();
$this->assertEquals(array(sprintf($this->deprecatedMessage, 'getFirstStep', 'getFirstStepNumber')), $this->getDeprecationNotices());
}
public function testBcMethodDelegation_getLastStep() {
$flow = $this->getFlowWithMockedMethods(array('getName', 'getLastStepNumber'));
$flow
->expects($this->once())
->method('getLastStepNumber')
;
$flow->getLastStep();
$this->assertEquals(array(sprintf($this->deprecatedMessage, 'getLastStep', 'getLastStepNumber')), $this->getDeprecationNotices());
}
public function testBcMethodDelegation_hasSkipStep() {
$flow = $this->getFlowWithMockedMethods(array('getName', 'isStepSkipped'));
$stepNumber = 1;
$flow
->expects($this->once())
->method('isStepSkipped')
->with($this->equalTo($stepNumber))
;
$flow->hasSkipStep($stepNumber);
$this->assertEquals(array(sprintf($this->deprecatedMessage, 'hasSkipStep', 'isStepSkipped')), $this->getDeprecationNotices());
}
}