Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
extensions.typo3.org
extensions.typo3.org
Commits
77279171
Commit
77279171
authored
Aug 08, 2019
by
Thomas Löffler
Browse files
Fix unit tests after upgrading nikic/php-parser
parent
c6555fe3
Changes
2
Hide whitespace changes
Inline
Side-by-side
extensions/ter_fe2/Classes/Visitor/ArrayAssurer.php
View file @
77279171
...
...
@@ -47,7 +47,7 @@ class ArrayAssurer extends \PhpParser\NodeVisitorAbstract
}
}
// We must not have another assignment
throw
new
\
UnexpectedValueException
()
;
return
\
PhpParser\NodeTraverser
::
REMOVE_NODE
;
}
if
(
!
(
$node
instanceof
Node\Name
...
...
@@ -57,9 +57,10 @@ class ArrayAssurer extends \PhpParser\NodeVisitorAbstract
||
$node
instanceof
Expr\ArrayItem
||
$node
instanceof
Expr\ConstFetch
||
$node
instanceof
Expr\Variable
||
$node
instanceof
Node\Stmt\Expression
)
)
{
return
false
;
return
\
PhpParser\NodeTraverser
::
REMOVE_NODE
;
}
}
}
extensions/ter_fe2/Tests/Unit/Utility/ArchiveUtilityTest.php
View file @
77279171
...
...
@@ -73,10 +73,9 @@ class ArchiveUtilityTest extends \Nimut\TestingFramework\TestCase\UnitTestCase
/**
* @test
*/
public
function
extractEmConfReturns
SaveArrayOnly
ForInvalidNodeFunction
()
public
function
extractEmConfReturns
Null
ForInvalidNodeFunction
()
{
$code
=
'<?php $EM_CONF[$_EXTKEY] = array(\'bar\' => \'baz\'); function foo() {} ?>'
;
$expected
=
[
'bar'
=>
'baz'
];
$subject
=
$this
->
getAccessibleMock
(
\
T3o\TerFe2\Utility\ArchiveUtility
::
class
,
...
...
@@ -84,8 +83,7 @@ class ArchiveUtilityTest extends \Nimut\TestingFramework\TestCase\UnitTestCase
);
$emConf
=
$subject
->
_call
(
'extractEmConf'
,
$code
);
$this
->
assertNotNull
(
$emConf
);
$this
->
assertSame
(
$expected
,
$emConf
);
$this
->
assertNull
(
$emConf
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment