![]() 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/magento/framework/App/Test/Unit/Route/ConfigInterface/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Framework\App\Test\Unit\Route\ConfigInterface; use Magento\Framework\App\Route\ConfigInterface; use Magento\Framework\App\Route\ConfigInterface\Proxy; use Magento\Framework\ObjectManager\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class ProxyTest extends TestCase { /** * @var Proxy */ protected $_proxy; /** * @var ConfigInterface|MockObject */ protected $_object; protected function setUp(): void { $this->_object = $this->createPartialMock( ConfigInterface::class, ['getRouteFrontName', 'getRouteByFrontName', 'getModulesByFrontName'] ); $objectManager = $this->createPartialMock(ObjectManager::class, ['get']); $objectManager->expects($this->once()) ->method('get') ->with(ConfigInterface::class) ->willReturn($this->_object); $this->_proxy = new Proxy( $objectManager, ConfigInterface::class ); } public function testGetRouteFrontName() { $routeId = 1; $scope = null; $this->_object->expects($this->once())->method('getRouteFrontName')->with($routeId, $scope); $this->_proxy->getRouteFrontName($routeId, $scope); } public function testGetRouteByFrontName() { $frontName = 'route'; $scope = null; $this->_object->expects($this->once())->method('getRouteByFrontName')->with($frontName, $scope); $this->_proxy->getRouteByFrontName($frontName, $scope); } public function testGetModulesByFrontName() { $frontName = 'route'; $scope = null; $this->_object->expects($this->once())->method('getModulesByFrontName')->with($frontName, $scope); $this->_proxy->getModulesByFrontName($frontName, $scope); } }