| @@ 146-156 (lines=11) @@ | ||
| 143 | /** |
|
| 144 | * @test |
|
| 145 | */ |
|
| 146 | public function shouldRemoveCommonNullValuedParameters() |
|
| 147 | { |
|
| 148 | $mapping = (new Mapping()) |
|
| 149 | ->setType(RootType::ID) |
|
| 150 | ->setParameter(SourceParameter::ID, null); |
|
| 151 | $expectation = (new Mapping()) |
|
| 152 | ->setType(RootType::ID); |
|
| 153 | $context = (new DefaultContext())->setRemoveUnknownParameters(false); |
|
| 154 | $result = (new Normalizer())->normalize($mapping, $context); |
|
| 155 | Assert::assertEquals($expectation, $result); |
|
| 156 | } |
|
| 157 | ||
| 158 | /** |
|
| 159 | * @test |
|
| @@ 174-184 (lines=11) @@ | ||
| 171 | /** |
|
| 172 | * @test |
|
| 173 | */ |
|
| 174 | public function shouldNormalizeParameterNames() |
|
| 175 | { |
|
| 176 | $mapping = (new Mapping()) |
|
| 177 | ->setType(DateType::ID) |
|
| 178 | ->setParameter(IgnoreMalformedParameter::FRIENDLY_ID, true); |
|
| 179 | $expectation = (new Mapping()) |
|
| 180 | ->setType(DateType::ID) |
|
| 181 | ->setParameter(IgnoreMalformedParameter::ID, true); |
|
| 182 | $result = (new Normalizer())->normalize($mapping); |
|
| 183 | Assert::assertEquals($expectation, $result); |
|
| 184 | } |
|
| 185 | } |
|
| 186 | ||