@@ 93-127 (lines=35) @@ | ||
90 | $this->messageListener->addMessage($event); |
|
91 | } |
|
92 | ||
93 | public function testMessageTypeSuccess() |
|
94 | { |
|
95 | $this->parameterResolver |
|
96 | ->expects($this->once()) |
|
97 | ->method('resolveApi') |
|
98 | ->will($this->returnValue(false)); |
|
99 | ||
100 | $event = $this->createDomainEventMock(); |
|
101 | $event |
|
102 | ->expects($this->once()) |
|
103 | ->method('getMessageType') |
|
104 | ->will($this->returnValue(null)); |
|
105 | ||
106 | $event |
|
107 | ->expects($this->once()) |
|
108 | ->method('isStopped') |
|
109 | ->will($this->returnValue(false)); |
|
110 | ||
111 | $event |
|
112 | ->expects($this->once()) |
|
113 | ->method('setMessageType') |
|
114 | ->with($this->identicalTo('success')); |
|
115 | ||
116 | $event |
|
117 | ->expects($this->once()) |
|
118 | ->method('getMessage') |
|
119 | ->will($this->returnValue($message = 'message')); |
|
120 | ||
121 | $event |
|
122 | ->expects($this->once()) |
|
123 | ->method('setMessage') |
|
124 | ->with($this->identicalTo($message)); |
|
125 | ||
126 | $this->messageListener->addMessage($event); |
|
127 | } |
|
128 | ||
129 | public function testMessageTypeError() |
|
130 | { |
|
@@ 129-163 (lines=35) @@ | ||
126 | $this->messageListener->addMessage($event); |
|
127 | } |
|
128 | ||
129 | public function testMessageTypeError() |
|
130 | { |
|
131 | $this->parameterResolver |
|
132 | ->expects($this->once()) |
|
133 | ->method('resolveApi') |
|
134 | ->will($this->returnValue(false)); |
|
135 | ||
136 | $event = $this->createDomainEventMock(); |
|
137 | $event |
|
138 | ->expects($this->once()) |
|
139 | ->method('getMessageType') |
|
140 | ->will($this->returnValue(null)); |
|
141 | ||
142 | $event |
|
143 | ->expects($this->once()) |
|
144 | ->method('isStopped') |
|
145 | ->will($this->returnValue(true)); |
|
146 | ||
147 | $event |
|
148 | ->expects($this->once()) |
|
149 | ->method('setMessageType') |
|
150 | ->with($this->identicalTo('error')); |
|
151 | ||
152 | $event |
|
153 | ->expects($this->once()) |
|
154 | ->method('getMessage') |
|
155 | ->will($this->returnValue($message = 'message')); |
|
156 | ||
157 | $event |
|
158 | ->expects($this->once()) |
|
159 | ->method('setMessage') |
|
160 | ->with($this->identicalTo($message)); |
|
161 | ||
162 | $this->messageListener->addMessage($event); |
|
163 | } |
|
164 | ||
165 | public function testMessageWithLabelPropertyPath() |
|
166 | { |