File tree Expand file tree Collapse file tree 2 files changed +3
-32
lines changed
dev/tests/static/testsuite/Magento/Test/Integrity/Library
lib/internal/Magento/Framework/View/Element/Html/Link Expand file tree Collapse file tree 2 files changed +3
-32
lines changed Original file line number Diff line number Diff line change @@ -96,35 +96,6 @@ function ($file) {
96
96
);
97
97
}
98
98
99
- public function testAppCodeUsage ()
100
- {
101
- $ files = Files::init ();
102
- $ componentRegistrar = new ComponentRegistrar ();
103
- $ libPaths = $ componentRegistrar ->getPaths (ComponentRegistrar::LIBRARY );
104
- $ invoker = new AggregateInvoker ($ this );
105
- $ invoker (
106
- function ($ file ) use ($ libPaths ) {
107
- $ content = file_get_contents ($ file );
108
- foreach ($ libPaths as $ libPath ) {
109
- if (strpos ($ file , $ libPath ) === 0 ) {
110
- $ this ->assertSame (
111
- 0 ,
112
- preg_match ('~(?<![a-z \\d_:]|->|function \\s)__ \\s* \\(~iS ' , $ content ),
113
- 'Function __() is defined outside of the library and must not be used there. ' .
114
- 'Replacement suggestion: new \\Magento \\Framework \\Phrase() '
115
- );
116
- }
117
- }
118
- },
119
- $ files ->getPhpFiles (
120
- Files::INCLUDE_PUB_CODE |
121
- Files::INCLUDE_LIBS |
122
- Files::AS_DATA_SET |
123
- Files::INCLUDE_NON_CLASSES
124
- )
125
- );
126
- }
127
-
128
99
/**
129
100
* @inheritdoc
130
101
*/
Original file line number Diff line number Diff line change @@ -104,21 +104,21 @@ protected function _toHtml()
104
104
if ($ this ->isCurrent ()) {
105
105
$ html = '<li class="nav item current"> ' ;
106
106
$ html .= '<strong> '
107
- . $ this ->escapeHtml (( string ) new \ Magento \ Framework \ Phrase ($ this ->getLabel ()))
107
+ . $ this ->escapeHtml (__ ($ this ->getLabel ()))
108
108
. '</strong> ' ;
109
109
$ html .= '</li> ' ;
110
110
} else {
111
111
$ html = '<li class="nav item ' . $ highlight . '"><a href=" ' . $ this ->escapeHtml ($ this ->getHref ()) . '" ' ;
112
112
$ html .= $ this ->getTitle ()
113
- ? ' title=" ' . $ this ->escapeHtml (( string ) new \ Magento \ Framework \ Phrase ($ this ->getTitle ())) . '" '
113
+ ? ' title=" ' . $ this ->escapeHtml (__ ($ this ->getTitle ())) . '" '
114
114
: '' ;
115
115
$ html .= $ this ->getAttributesHtml () . '> ' ;
116
116
117
117
if ($ this ->getIsHighlighted ()) {
118
118
$ html .= '<strong> ' ;
119
119
}
120
120
121
- $ html .= $ this ->escapeHtml (( string ) new \ Magento \ Framework \ Phrase ($ this ->getLabel ()));
121
+ $ html .= $ this ->escapeHtml (__ ($ this ->getLabel ()));
122
122
123
123
if ($ this ->getIsHighlighted ()) {
124
124
$ html .= '</strong> ' ;
You can’t perform that action at this time.
0 commit comments