8000 [OptionsResolve] Revert change in tests for a not-merged change in code · symfony/symfony@15f0855 · GitHub
[go: up one dir, main page]

Skip to content

Commit 15f0855

Browse files
[OptionsResolve] Revert change in tests for a not-merged change in code
1 parent 6d5c91b commit 15f0855

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ public function testFailIfSetAllowedTypesFromLazyOption()
776776
public function testResolveFailsIfInvalidTypedArray()
777777
{
778778
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
779-
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "int[]", but one of the elements is of type "DateTime".');
779+
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "int[]", but one of the elements is of type "DateTime[]".');
780780
$this->resolver->setDefined('foo');
781781
$this->resolver->setAllowedTypes('foo', 'int[]');
782782

@@ -796,10 +796,9 @@ public function testResolveFailsWithNonArray()
796796
public function testResolveFailsIfTypedArrayContainsInvalidTypes()
797797
{
798798
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
799-
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "int[]", but one of the elements is of type "stdClass|array|DateTime".');
799+
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "int[]", but one of the elements is of type "stdClass[]".');
800800
$this->resolver->setDefined('foo');
801801
$this->resolver->setAllowedTypes('foo', 'int[]');
802-
803802
$values = range(1, 5);
804803
$values[] = new \stdClass();
805804
$values[] = [];
@@ -812,7 +811,7 @@ public function testResolveFailsIfTypedArrayContainsInvalidTypes()
812811
public function testResolveFailsWithCorrectLevelsButWrongScalar()
813812
{
814813
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
815-
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "double".');
814+
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "double[][]".');
816815
$this->resolver->setDefined('foo');
817816
$this->resolver->setAllowedTypes('foo', 'int[][]');
818817

@@ -848,11 +847,6 @@ public function provideInvalidTypes()
848847
[42, 'string', 'The option "option" with value 42 is expected to be of type "string", but is of type "integer".'],
849848
[null, 'string', 'The option "option" with value null is expected to be of type "string", but is of type "NULL".'],
850849
['bar', '\stdClass', 'The option "option" with value "bar" is expected to be of type "\stdClass", but is of type "string".'],
851-
[['foo', 12], 'string[]', 'The option "option" with value array is expected to be of type "string[]", but one of the elements is of type "integer".'],
852-
[123, ['string[]', 'string'], 'The option "option" with value 123 is expected to be of type "string[]" or "string", but is of type "integer".'],
853-
[[null], ['string[]', 'string'], 'The option "option" with value array is expected to be of type "string[]" or "string", but one of the elements is of type "NULL".'],
854-
[['string', null], ['string[]', 'string'], 'The option "option" with value array is expected to be of type "string[]" or "string", but one of the elements is of type "NULL".'],
855-
[[\stdClass::class], ['string'], 'The option "option" with value array is expected to be of type "string", but is of type "array".'],
856850
];
857851
}
858852

@@ -901,7 +895,6 @@ public function testResolveSucceedsIfTypedArray()
901895
new \DateTime(),
902896
],
903897
];
904-
905898
$result = $this->resolver->resolve($data);
906899
$this->assertEquals($data, $result);
907900
}
@@ -1905,7 +1898,7 @@ public function testNested2Arrays()
19051898
public function testNestedArraysException()
19061899
{
19071900
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
1908-
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "float[][][][]", but one of the elements is of type "integer".');
1901+
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "float[][][][]", but one of the elements is of type "integer[][][][]".');
19091902
$this->resolver->setDefined('foo');
19101903
$this->resolver->setAllowedTypes('foo', 'float[][][][]');
19111904

@@ -1923,7 +1916,7 @@ public function testNestedArraysException()
19231916
public function testNestedArrayException1()
19241917
{
19251918
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
1926-
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "boolean|string|array".');
1919+
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "boolean[][]".');
19271920
$this->resolver->setDefined('foo');
19281921
$this->resolver->setAllowedTypes('foo', 'int[][]');
19291922
$this->resolver->resolve([
@@ -1936,7 +1929,7 @@ public function testNestedArrayException1()
19361929
public function testNestedArrayException2()
19371930
{
19381931
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
1939-
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "boolean|string|array".');
1932+
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "boolean[][]".');
19401933
$this->resolver->setDefined('foo');
19411934
$this->resolver->setAllowedTypes('foo', 'int[][]');
19421935
$this->resolver->resolve([
@@ -1949,7 +1942,7 @@ public function testNestedArrayException2()
19491942
public function testNestedArrayException3()
19501943
{
19511944
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
1952-
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "string|integer".');
1945+
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "string[][]".');
19531946
$this->resolver->setDefined('foo');
19541947
$this->resolver->setAllowedTypes('foo', 'string[][][]');
19551948
$this->resolver->resolve([
@@ -1962,7 +1955,7 @@ public function testNestedArrayException3()
19621955
public function testNestedArrayException4()
19631956
{
19641957
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
1965-
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "integer".');
1958+
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "integer[][][]".');
19661959
$this->resolver->setDefined('foo');
19671960
$this->resolver->setAllowedTypes('foo', 'string[][][]');
19681961
$this->resolver->resolve([
@@ -1976,7 +19 67DA 69,7 @@ public function testNestedArrayException4()
19761969
public function testNestedArrayException5()
19771970
{
19781971
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
1979-
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "string[]", but one of the elements is of type "array".');
1972+
$this->expectExceptionMessage('The option "foo" with value array is expected to be of type "string[]", but one of the elements is of type "array[]".');
19801973
$this->resolver->setDefined('foo');
19811974
$this->resolver->setAllowedTypes('foo', 'string[]');
19821975
$this->resolver->resolve([

0 commit comments

Comments
 (0)
0