![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/yireo/magento2-disablelog2/Test/Unit/Plugin/Customer/ |
<?php declare(strict_types=1); namespace Yireo\DisableLog2\Test\Unit\Plugin\Customer; use Exception; use PHPUnit\Framework\TestCase; use Magento\Customer\Model\Logger as CustomerLogger; use Yireo\DisableLog2\Plugin\Customer\Logger as CustomerLoggerPlugin; /** * Class LoggerTest * @package Yireo\DisableLog2\Test\Unit\Plugin\Customer */ class LoggerTest extends TestCase { /** * */ public function testAroundLogDoesNotCallCallable() { $loggerPlugin = new CustomerLoggerPlugin(); $this->assertInstanceOf(CustomerLoggerPlugin::class, $loggerPlugin); $customerLoggerMock = $this->getMockBuilder(CustomerLogger::class) ->disableOriginalConstructor() ->getMock(); $callable = $this->getCallable(); $loggerPlugin->aroundLog($customerLoggerMock, $callable); } /** * @return callable */ private function getCallable() { return new class() { public function __invoke() { throw new Exception(); } }; } }