Skip to content

Commit 33c50b1

Browse files
committed
MAGETWO-31059: Integration tests with fatals, code under test and framework adaptation
- Fix tests
1 parent 0639b9d commit 33c50b1

File tree

3 files changed

+15
-7
lines changed
  • dev/tests
    • integration/testsuite/Magento/Framework/View/Layout/Reader
    • unit/testsuite/Magento/Framework/Module/Declaration/Converter
  • lib/internal/Magento/Framework/Webapi

3 files changed

+15
-7
lines changed

dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/BlockTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ public function setUp()
4343
public function testInterpretBlockDirective()
4444
{
4545
$pageXml = new \Magento\Framework\View\Layout\Element(
46-
__DIR__ . '/_files/_layout_update_block.xml', 0, true
46+
__DIR__ . '/_files/_layout_update_block.xml',
47+
0,
48+
true
4749
);
4850
$parentElement = new \Magento\Framework\View\Layout\Element('<page></page>');
4951

@@ -74,7 +76,9 @@ public function testInterpretBlockDirective()
7476
public function testInterpretReferenceBlockDirective()
7577
{
7678
$pageXml = new \Magento\Framework\View\Layout\Element(
77-
__DIR__ . '/_files/_layout_update_reference.xml', 0, true
79+
__DIR__ . '/_files/_layout_update_reference.xml',
80+
0,
81+
true
7882
);
7983
$parentElement = new \Magento\Framework\View\Layout\Element('<page></page>');
8084

dev/tests/unit/testsuite/Magento/Framework/Module/Declaration/Converter/DomTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,20 @@ public function testConvertWithValidDom()
3434
public function testConvertWithInvalidDom($xmlString)
3535
{
3636
$dom = new \DOMDocument();
37-
$dom->loadXML($xmlString);
38-
$this->_converter->convert($dom);
37+
try {
38+
$dom->loadXML($xmlString);
39+
$this->_converter->convert($dom);
40+
} catch(\PHPUnit_Framework_Error $ex) {
41+
// do nothing because we expect \Exception but not \PHPUnit_Framework_Error
42+
}
3943
}
4044

4145
public function convertWithInvalidDomDataProvider()
4246
{
4347
return [
4448
'Module node without "name" attribute' => ['<?xml version="1.0"?><config><module /></config>'],
4549
'Sequence module node without "name" attribute' => [
46-
'<?xml dbversion="1.0"?><config><module name="Module_One" setup_version="1.0.0.0">' .
50+
'<?xml version="1.0"?><config><module name="Module_One" setup_version="1.0.0.0">' .
4751
'<sequence><module/></sequence></module></config>',
4852
],
4953
];

lib/internal/Magento/Framework/Webapi/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public function __construct(
4545
*
4646
* Added CGI environment support.
4747
*/
48-
public function getHeader($header)
48+
public function getHeader($header, $default = false)
4949
{
50-
$headerValue = parent::getHeader($header);
50+
$headerValue = parent::getHeader($header, $default);
5151
if ($headerValue == false) {
5252
/** Workaround for hhvm environment */
5353
$header = 'REDIRECT_HTTP_' . strtoupper(str_replace('-', '_', $header));

0 commit comments

Comments
 (0)