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 8
8
9
9
<pages xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
10
10
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" >
12
12
<section name =" CmsNewBlockBlockActionsSection" />
13
13
<section name =" CmsNewBlockBlockBasicFieldsSection" />
14
14
</page >
Original file line number Diff line number Diff line change 11
11
<section name =" CmsNewBlockBlockBasicFieldsSection" >
12
12
<element name =" title" type =" input" selector =" input[name=title]" />
13
13
<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 " />
15
15
</section >
16
16
</sections >
Original file line number Diff line number Diff line change @@ -31,13 +31,24 @@ class PublicCodeTest extends \PHPUnit\Framework\TestCase
31
31
*/
32
32
public function testAllBlocksReferencedInLayoutArePublic ($ layoutFile )
33
33
{
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
+
34
45
$ nonPublishedBlocks = [];
35
46
$ xml = simplexml_load_file ($ layoutFile );
36
47
$ elements = $ xml ->xpath ('//block | //referenceBlock ' ) ?: [];
37
48
/** @var $node \SimpleXMLElement */
38
49
foreach ($ elements as $ node ) {
39
50
$ class = (string ) $ node ['class ' ];
40
- if ($ class && \class_exists ($ class )) {
51
+ if ($ class && \class_exists ($ class ) && ! in_array ( $ class , $ whiteListBlocks ) ) {
41
52
$ reflection = (new \ReflectionClass ($ class ));
42
53
if (strpos ($ reflection ->getDocComment (), '@api ' ) === false ) {
43
54
$ nonPublishedBlocks [] = $ class ;
You can’t perform that action at this time.
0 commit comments