abinjohnedamanaabinjohnedamana MemberComments: 14 Received thanks: 0 Member since: February 21 edited July 22

I created a logger service for my plugin.

I added the following lines of code in  Resources/services.xml file

service id="abandoned_cart_notification.logger_service" class="HatslogicAbandonedCartNotification\Components\Services\LoggerService"
            argument type="service" id="pluginlogger"
        service (I have removed the xml tags. beacuse it is not showing in the browser)

Then i added 

use HatslogicAbandonedCartNotification\Components\LoggerServiceInterface;

and         /** @var LoggerServiceInterface $loggerService */
        $loggerService = Shopware()->Container()->get('abandoned_cart_notification.logger_service');

in Tests\Functional\Components\Services\LoggerServiceTest.php file 

When i execute the phpunit i got the following error 

 HatslogicAbandonedCartNotification\Tests\Functional\Components\Services\LoggerServiceTest::test_warning_adds_line
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "abandoned_cart_notification.logger_service".

How I can fix this?

 I am using shopware : 5.5.10 and PHPUnit 7.5.13.

Please help me.

 

Sign In or Register to comment.