File tree Expand file tree Collapse file tree 6 files changed +16
-20
lines changed
dev/tests/static/testsuite/Magento/Test/Integrity/App/Language
lib/internal/Magento/Framework
Config/Test/Unit/Composer
Test/Unit/Module/I18n/Parser/Adapter Expand file tree Collapse file tree 6 files changed +16
-20
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,9 @@ protected function prepareParser()
104
104
$ phraseCollector = new \Magento \Setup \Module \I18n \Parser \Adapter \Php \Tokenizer \PhraseCollector (
105
105
new \Magento \Setup \Module \I18n \Parser \Adapter \Php \Tokenizer ()
106
106
);
107
- $ fileSystem = new \Magento \Framework \Filesystem \Driver \File ();
108
107
$ adapters = [
109
108
'php ' => new \Magento \Setup \Module \I18n \Parser \Adapter \Php ($ phraseCollector ),
110
- 'js ' => new \Magento \Setup \Module \I18n \Parser \Adapter \Js ($ fileSystem ),
109
+ 'js ' => new \Magento \Setup \Module \I18n \Parser \Adapter \Js (),
111
110
'xml ' => new \Magento \Setup \Module \I18n \Parser \Adapter \Xml (),
112
111
'html ' => new \Magento \Setup \Module \I18n \Parser \Adapter \Html (),
113
112
];
Original file line number Diff line number Diff line change @@ -49,10 +49,10 @@ public function testGet()
49
49
$ this ->assertSame (['3 ' , '4 ' ], $ this ->object ->get ('baz ' ));
50
50
$ nested = $ this ->object ->get ('nested ' );
51
51
$ this ->assertInstanceOf ('\StdClass ' , $ nested );
52
- $ this ->assertObjectHasAttribute ('one ' , $ nested );
52
+ $ this ->assertObjectHasProperty ('one ' , $ nested );
53
53
$ this ->assertEquals ('5 ' , $ nested ->one );
54
54
$ this ->assertEquals ('5 ' , $ this ->object ->get ('nested->one ' ));
55
- $ this ->assertObjectHasAttribute ('two ' , $ nested );
55
+ $ this ->assertObjectHasProperty ('two ' , $ nested );
56
56
$ this ->assertEquals ('6 ' , $ nested ->two );
57
57
$ this ->assertEquals ('6 ' , $ this ->object ->get ('nested->two ' ));
58
58
$ this ->assertEquals (
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ public function testUnsetSelf($xmlData)
19
19
{
20
20
/** @var Element $xml */
21
21
$ xml = simplexml_load_file ($ xmlData [0 ], $ xmlData [1 ]);
22
- $ this ->assertObjectHasAttribute ('node4 ' , $ xml ->node3 );
22
+ $ this ->assertObjectHasProperty ('node4 ' , $ xml ->node3 );
23
23
$ xml ->node3 ->unsetSelf ();
24
- $ this ->assertObjectNotHasAttribute ('node4 ' , $ xml ->node3 );
25
- $ this ->assertObjectNotHasAttribute ('node3 ' , $ xml );
26
- $ this ->assertObjectHasAttribute ('node1 ' , $ xml );
24
+ $ this ->assertObjectNotHasProperty ('node4 ' , $ xml ->node3 );
25
+ $ this ->assertObjectNotHasProperty ('node3 ' , $ xml );
26
+ $ this ->assertObjectHasProperty ('node1 ' , $ xml );
27
27
}
28
28
29
29
/**
Original file line number Diff line number Diff line change @@ -24,10 +24,9 @@ class Js extends AbstractAdapter
24
24
*
25
25
* @param \Magento\Framework\Filesystem\Driver\File $fileSystem
26
26
*/
27
- public function __construct (
28
- File $ fileSystem
29
- ) {
30
- $ this ->_filesystem = $ fileSystem ;
27
+ public function __construct ()
28
+ {
29
+ $ this ->_filesystem = new \Magento \Framework \Filesystem \Driver \File ();
31
30
}
32
31
/**
33
32
* Covers
@@ -51,7 +50,6 @@ public function __construct(
51
50
*/
52
51
protected function _parse ()
53
52
{
54
-
55
53
$ fileHandle = $ this ->_filesystem ->fileOpen ($ this ->_file , 'r ' );
56
54
$ lineNumber = 0 ;
57
55
try {
Original file line number Diff line number Diff line change @@ -52,11 +52,10 @@ public static function getDictionaryGenerator()
52
52
$ filesCollector = new FilesCollector ();
53
53
54
54
$ phraseCollector = new Parser \Adapter \Php \Tokenizer \PhraseCollector (new Parser \Adapter \Php \Tokenizer ());
55
- $ fileSystem = new \Magento \Framework \Filesystem \Driver \File ();
56
55
$ adapters = [
57
56
'php ' => new Parser \Adapter \Php ($ phraseCollector ),
58
57
'html ' => new Parser \Adapter \Html (),
59
- 'js ' => new Parser \Adapter \Js ($ fileSystem ),
58
+ 'js ' => new Parser \Adapter \Js (),
60
59
'xml ' => new Parser \Adapter \Xml (),
61
60
];
62
61
Original file line number Diff line number Diff line change @@ -43,31 +43,31 @@ public function testParse()
43
43
[
44
44
'phrase ' => 'Phrase 1 ' ,
45
45
'file ' => $ this ->_testFile ,
46
- 'line ' => $ this -> _stringsCount - 4 ,
46
+ 'line ' => 1 ,
47
47
'quote ' => Phrase::QUOTE_SINGLE ,
48
48
],
49
49
[
50
50
'phrase ' => 'Phrase 2 %1 ' ,
51
51
'file ' => $ this ->_testFile ,
52
- 'line ' => $ this -> _stringsCount - 3 ,
52
+ 'line ' => 1 ,
53
53
'quote ' => Phrase::QUOTE_DOUBLE
54
54
],
55
55
[
56
56
'phrase ' => 'Field ' ,
57
57
'file ' => $ this ->_testFile ,
58
- 'line ' => $ this -> _stringsCount - 2 ,
58
+ 'line ' => 1 ,
59
59
'quote ' => Phrase::QUOTE_SINGLE
60
60
],
61
61
[
62
62
'phrase ' => ' is required. ' ,
63
63
'file ' => $ this ->_testFile ,
64
- 'line ' => $ this -> _stringsCount - 2 ,
64
+ 'line ' => 1 ,
65
65
'quote ' => Phrase::QUOTE_SINGLE
66
66
],
67
67
[
68
68
'phrase ' => 'Welcome, %1! ' ,
69
69
'file ' => $ this ->_testFile ,
70
- 'line ' => $ this -> _stringsCount - 1 ,
70
+ 'line ' => 1 ,
71
71
'quote ' => Phrase::QUOTE_SINGLE
72
72
]
73
73
];
You can’t perform that action at this time.
0 commit comments