8000 minor #26125 [PropertyInfo] fix tests (xabbuh) · symfony/symfony@3ef76bf · GitHub
[go: up one dir, main page]

Skip to content

Commit 3ef76bf

Browse files
minor #26125 [PropertyInfo] fix tests (xabbuh)
This PR was merged into the 4.1-dev branch. Discussion ---------- [PropertyInfo] fix tests | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 00cdec9 [PropertyInfo] fix tests
2 parents 2ab947f + 00cdec9 commit 3ef76bf

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

src/Symfony/Component/PropertyInfo/Tests/Extractors/PhpDocExtractorTest.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,6 @@ public function testExtract($property, array $type = null, $shortDescription, $l
4040
$this->assertSame($longDescription, $this->extractor->getLongDescription('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy', $property));
4141
}
4242

43-
public function testParamTagTypeIsOmitted()
44-
{
45-
$this->assertNull($this->extractor->getTypes(OmittedParamTagTypeDocBlock::class, 'omittedType'));
46-
}
47-
48-
/**
49-
* @dataProvider typesWithCustomPrefixesProvider
50-
*/
51-
public function testExtractTypesWithCustomPrefixes($property, array $type = null)
52-
{
53-
$customExtractor = new PhpDocExtractor(null, array('add', 'remove'), array('is', 'can'));
54-
55-
$this->assertEquals($type, $customExtractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy', $property));
56-
}
57-
58-
/**
59-
* @dataProvider typesWithNoPrefixesProvider
60-
*/
61-
public function testExtractTypesWithNoPrefixes($property, array $type = null)
62-
{
63-
$noPrefixExtractor = new PhpDocExtractor(null, array(), array(), array());
64-
65-
$this->assertEquals($type, $noPrefixExtractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy', $property));
66-
}
67-
6843
public function typesProvider()
6944
{
7045
return array(
@@ -102,6 +77,21 @@ public function typesProvider()
10277
);
10378
}
10479

80+
public function testParamTagTypeIsOmitted()
81+
{
82+
$this->assertNull($this->extractor->getTypes(OmittedParamTagTypeDocBlock::class, 'omittedType'));
83+
}
84+
85+
/**
86+
* @dataProvider typesWithCustomPrefixesProvider
87+
*/
88+
public function testExtractTypesWithCustomPrefixes($property, array $type = null)
89+
{
90+
$customExtractor = new PhpDocExtractor(null, array('add', 'remove'), array('is', 'can'));
91+
92+
$this->assertEquals($type, $customExtractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy', $property));
93+
}
94+
10595
public function typesWithCustomPrefixesProvider()
10696
{
10797
return array(
@@ -130,13 +120,23 @@ public function typesWithCustomPrefixesProvider()
130120
array('d', array(new Type(Type::BUILTIN_TYPE_BOOL)), null, null),
131121
array('e', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_RESOURCE))), null, null),
132122
array('f', array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTime'))), null, null),
133-
array('g', array(new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true)), 'Nullable array.', null),
123+
array('g', null),
134124
array('donotexist', null, null, null),
135125
array('staticGetter', null, null, null),
136126
array('staticSetter', null, null, null),
137127
);
138128
}
139129

130+
/**
131+
* @dataProvider typesWithNoPrefixesProvider
132+
*/
133+
public function testExtractTypesWithNoPrefixes($property, array $type = null)
134+
{
135+
$noPrefixExtractor = new PhpDocExtractor(null, array(), array(), array());
136+
137+
$this->assertEquals($type, $noPrefixExtractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy', $property));
138+
}
139+
140140
public function typesWithNoPrefixesProvider()
141141
{
142142
return array(
@@ -165,7 +165,7 @@ public function typesWithNoPrefixesProvider()
165165
array('d', null, null, null),
166166
array('e', null, null, null),
167167
array('f', null, null, null),
168-
array('g', array(new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true)), 'Nullable array.', null),
168+
array('g', null),
169169
array('donotexist', null, null, null),
170170
array('staticGetter', null, null, null),
171171
array('staticSetter', null, null, null),

src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testGetPropertiesWithCustomPrefixes()
7373
'collection',
7474
'B',
7575
'Guid',
76-
'g',
76+
'array',
7777
'emptyVar',
7878
'foo',
7979
'foo2',
@@ -101,7 +101,7 @@ public function testGetPropertiesWithNoPrefixes()
101101
'collection',
102102
'B',
103103
'Guid',
104-
'g',
104+
'array',
105105
'emptyVar',
106106
'foo',
107107
'foo2',

0 commit comments

Comments
 (0)
0