@@ 159-180 (lines=22) @@ | ||
156 | /** |
|
157 | * @test |
|
158 | */ |
|
159 | public function shouldNotResolveValueOnNull() |
|
160 | { |
|
161 | $this->dbalColumn->method('getName')->willReturn("some_column"); |
|
162 | ||
163 | /** @var HydrationContextInterface $context */ |
|
164 | $context = $this->createMock(HydrationContextInterface::class); |
|
165 | ||
166 | /** @var array $dataFromAdditionalColumns */ |
|
167 | $dataFromAdditionalColumns = [ |
|
168 | 'some_column' => false |
|
169 | ]; |
|
170 | ||
171 | /** @var mixed $expectedResult */ |
|
172 | $expectedResult = 'bar'; |
|
173 | ||
174 | $this->innerMapping->expects($this->never())->method('resolveValue'); |
|
175 | ||
176 | $this->assertNull($this->mapping->resolveValue( |
|
177 | $context, |
|
178 | $dataFromAdditionalColumns |
|
179 | )); |
|
180 | } |
|
181 | ||
182 | /** |
|
183 | * @test |
@@ 216-230 (lines=15) @@ | ||
213 | /** |
|
214 | * @test |
|
215 | */ |
|
216 | public function shouldWakeUpInnerMapping() |
|
217 | { |
|
218 | /** @var ContainerInterface $container */ |
|
219 | $container = $this->createMock(ContainerInterface::class); |
|
220 | ||
221 | /** @var HydrationContextInterface $context */ |
|
222 | $context = $this->createMock(HydrationContextInterface::class); |
|
223 | ||
224 | $container->method("has")->willReturn(true); |
|
225 | $container->method("get")->willReturn("Foo bar baz"); |
|
226 | ||
227 | $this->serviceMapping->wakeUpMapping($container); |
|
228 | ||
229 | $this->assertSame("Foo bar baz", $this->serviceMapping->resolveValue($context, [])); |
|
230 | } |
|
231 | ||
232 | } |
|
233 |