Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bbe72f9

Browse filesBrowse files
committed
minor #16905 [Form] Add missing tests for StringUtil::fqcnToBlockPrefix() (jakzal)
This PR was merged into the 2.8 branch. Discussion ---------- [Form] Add missing tests for StringUtil::fqcnToBlockPrefix() | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16762 | License | MIT | Doc PR | - Commits ------- 862b460 [Form] Add missing tests for StringUtil::fqcnToBlockPrefix()
2 parents afc6ee4 + 862b460 commit bbe72f9
Copy full SHA for bbe72f9

File tree

1 file changed

+27
-0
lines changed
Filter options

1 file changed

+27
-0
lines changed

‎src/Symfony/Component/Form/Tests/Util/StringUtilTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Util/StringUtilTest.php
+27Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,31 @@ public function spaceProvider()
7474
// array('200B'),
7575
);
7676
}
77+
78+
/**
79+
* @dataProvider fqcnToBlockPrefixProvider
80+
*/
81+
public function testFqcnToBlockPrefix($fqcn, $expectedBlockPrefix)
82+
{
83+
$blockPrefix = StringUtil::fqcnToBlockPrefix($fqcn);
84+
85+
$this->assertSame($expectedBlockPrefix, $blockPrefix);
86+
}
87+
88+
public function fqcnToBlockPrefixProvider()
89+
{
90+
return array(
91+
array('TYPE', 'type'),
92+
array('\Type', 'type'),
93+
array('\UserType', 'user'),
94+
array('UserType', 'user'),
95+
array('Vendor\Name\Space\Type', 'type'),
96+
array('Vendor\Name\Space\UserForm', 'user_form'),
97+
array('Vendor\Name\Space\UserType', 'user'),
98+
array('Vendor\Name\Space\usertype', 'user'),
99+
array('Symfony\Component\Form\Form', 'form'),
100+
array('Vendor\Name\Space\BarTypeBazType', 'bar_type_baz'),
101+
array('FooBarBazType', 'foo_bar_baz'),
102+
);
103+
}
77104
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.