File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
acceptance/tests/functional/Magento/FunctionalTest/Cms
static/testsuite/Magento/Test/Integrity Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 88
99<pages xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
1010 xsi : noNamespaceSchemaLocation =" ../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd" >
11- <page name =" CmsNewBlock" url =" admin/cms/block/new" area = " admin " module =" Magento_Cms" >
11+ <page name =" CmsNewBlock" area =" admin" url = " /cms/block/new" module =" Magento_Cms" >
1212 <section name =" CmsNewBlockBlockActionsSection" />
1313 <section name =" CmsNewBlockBlockBasicFieldsSection" />
1414 </page >
Original file line number Diff line number Diff line change 1111 <section name =" CmsNewBlockBlockBasicFieldsSection" >
1212 <element name =" title" type =" input" selector =" input[name=title]" />
1313 <element name =" identifier" type =" input" selector =" input[name=identifier]" />
14- <element name =" wysiwyg_hr_element " type =" input" selector =" #cms_block_form_content_hr " />
14+ <element name =" content_textarea " type =" input" selector =" #cms_block_form_content " />
1515 </section >
1616</sections >
Original file line number Diff line number Diff line change @@ -31,13 +31,24 @@ class PublicCodeTest extends \PHPUnit\Framework\TestCase
3131 */
3232 public function testAllBlocksReferencedInLayoutArePublic ($ layoutFile )
3333 {
34+ // A block can be whitelisted and thus not be required to be public
35+ $ whiteListFiles = str_replace ('\\' , '/ ' , realpath (__DIR__ ))
36+ . '/_files/whitelist/public_code*.txt ' ;
37+ $ whiteListBlocks = [];
38+ foreach (glob ($ whiteListFiles ) as $ fileName ) {
39+ $ whiteListBlocks = array_merge (
40+ $ whiteListBlocks ,
41+ file ($ fileName , FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES )
42+ );
43+ }
44+
3445 $ nonPublishedBlocks = [];
3546 $ xml = simplexml_load_file ($ layoutFile );
3647 $ elements = $ xml ->xpath ('//block | //referenceBlock ' ) ?: [];
3748 /** @var $node \SimpleXMLElement */
3849 foreach ($ elements as $ node ) {
3950 $ class = (string ) $ node ['class ' ];
40- if ($ class && \class_exists ($ class )) {
51+ if ($ class && \class_exists ($ class ) && ! in_array ( $ class , $ whiteListBlocks ) ) {
4152 $ reflection = (new \ReflectionClass ($ class ));
4253 if (strpos ($ reflection ->getDocComment (), '@api ' ) === false ) {
4354 $ nonPublishedBlocks [] = $ class ;
You can’t perform that action at this time.
0 commit comments