Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RouteParamsResolverFactoryTest.php
Go to the documentation of this file.
1 <?php
7 
9 
10 class RouteParamsResolverFactoryTest extends \PHPUnit\Framework\TestCase
11 {
13  protected $object;
14 
16  protected $objectManager;
17 
18  protected function setUp()
19  {
20  $this->objectManager = $this->createMock(\Magento\Framework\ObjectManagerInterface::class);
21 
22  $objectManager = new ObjectManager($this);
23  $this->object = $objectManager->getObject(
24  \Magento\Framework\Url\RouteParamsResolverFactory::class,
25  ['objectManager' => $this->objectManager]
26  );
27  }
28 
29  public function testCreate()
30  {
31  $producedInstance = $this->createMock(\Magento\Framework\Url\RouteParamsResolverInterface::class);
32  $this->objectManager->expects($this->once())
33  ->method('create')
34  ->with(\Magento\Framework\Url\RouteParamsResolverInterface::class)
35  ->will($this->returnValue($producedInstance));
36 
37  $this->assertSame($producedInstance, $this->object->create([]));
38  }
39 }