4

In magento 2.0, when I run the magento setup:di:compile command, it gives an error:

[ErrorException] Declaration of Magento\Newsletter\Test\Unit\Model\Queue\TransportBuilderTes t::testGetTransport() should be compatible with Magento\Framework\Mail\Test \Unit\Template\TransportBuilderTest::testGetTransport($templateType, $messa geType, $bodyText, $templateNamespace)

How to solve this?

7ochem
7,61516 gold badges54 silver badges82 bronze badges
asked Dec 4, 2015 at 8:22

1 Answer 1

2

For the moment change the

public function testGetTransport(
 $templateType = TemplateTypesInterface::TYPE_HTML,
 $messageType = MessageInterface::TYPE_HTML,
 $bodyText = '<h1>Html message</h1>'
)

to

public function testGetTransport(
 $templateType = TemplateTypesInterface::TYPE_HTML,
 $messageType = MessageInterface::TYPE_HTML,
 $bodyText = '<h1>Html message</h1>',
 $templateNamespace ='Magento\Newsletter\Test\Unit\Model\Queue'
)


in app/code/Magento/Newsletter/Test/Unit/Model/Queue/TransportBuilderTest.php

The string use for $templateNamespace can be probably wrong (however you can keep empty string if you want as this text is not using by the function)

answered Dec 21, 2015 at 13:08
1
  • For Magento2 release version, in /vendor/magento/module-newsletter/Test/Unit/Model/Queue/TransportBuilderTest.php Commented Jan 8, 2016 at 10:31

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.