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?

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)

  • For Magento2 release version, in /vendor/magento/module-newsletter/Test/Unit/Model/Queue/TransportBuilderTest.php – Mike Jan 8 '16 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.