Magento 2.0 magento setup:di:compile
command gives me following errors:
[ErrorException] Declaration of
Magento\Newsletter\Test\Unit\Model\Queue\TransportBuilderTest::testGetTransport()
should be compatible with
Magento\Framework\Mail\Test\Unit\Template\TransportBuilderTest::testGetTransport($templateType, $messageType, $bodyText, $templateNamespace)
FIX:
Update app/code/Magento/Newsletter/Test/Unit/Model/Queue/TransportBuilderTest.php
1 2 3 4 | public function testGetTransport($templateType = TemplateTypesInterface::TYPE_HTML, $messageType = MessageInterface::TYPE_HTML, $bodyText = '<h1>Html message</h1>' ) |
to
1 2 3 4 5 6 | public function testGetTransport( $templateType = TemplateTypesInterface::TYPE_HTML, $messageType = MessageInterface::TYPE_HTML, $bodyText = '<h1>Html message</h1>', $templateNamespace ='Magento\Newsletter\Test\Unit\Model\Queue' ) |
[ReflectionException]
Class Not_Existing_Class does not exist
FIX:
Update setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php
1 | if (preg_match($pattern, $fileItem->getRealPath())) { |
to
1 | if (preg_match($pattern, str_replace('\\', '/', $fileItem->getRealPath()))) { |
Hope this helps you to run the compile successfully!
Check our article about magento 2 complete cli commands list