Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
RouterTest Class Reference
Inheritance diagram for RouterTest:

Public Member Functions

 testRouterCanProcessRequestsWithProperPathInfo ()
 
 testGetControllerClassName ($module, $controller, $className)
 
 getControllerClassNameDataProvider ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $model
 
 $objectManager
 

Detailed Description

@magentoAppArea adminhtml @SuppressWarnings(PHPMD.CouplingBetweenObjects)

Definition at line 12 of file RouterTest.php.

Member Function Documentation

◆ getControllerClassNameDataProvider()

getControllerClassNameDataProvider ( )

Definition at line 50 of file RouterTest.php.

51  {
52  return [
53  ['Magento_TestModule', 'controller', \Magento\TestModule\Controller\Adminhtml\Controller::class],
54  ];
55  }

◆ setUp()

setUp ( )
protected

Definition at line 24 of file RouterTest.php.

25  {
27  $this->model = $this->objectManager->create(\Magento\Backend\App\Router::class);
28  }

◆ testGetControllerClassName()

testGetControllerClassName (   $module,
  $controller,
  $className 
)
Parameters
string$module
string$controller
string$className@dataProvider getControllerClassNameDataProvider

Definition at line 45 of file RouterTest.php.

46  {
47  $this->assertEquals($className, $this->model->getActionClassName($module, $controller));
48  }
$controller
Definition: info.phtml:14
if($currentSelectedMethod==$_code) $className
Definition: form.phtml:31

◆ testRouterCanProcessRequestsWithProperPathInfo()

testRouterCanProcessRequestsWithProperPathInfo ( )

Definition at line 30 of file RouterTest.php.

31  {
32  $request = $this->createMock(\Magento\Framework\App\Request\Http::class);
33  $request->expects($this->once())->method('getPathInfo')->will($this->returnValue('backend/admin/dashboard'));
34 
35  $this->assertInstanceOf(\Magento\Backend\Controller\Adminhtml\Dashboard::class, $this->model->match($request));
36  }

Field Documentation

◆ $model

$model
protected

Definition at line 17 of file RouterTest.php.

◆ $objectManager

$objectManager
protected

Definition at line 22 of file RouterTest.php.


The documentation for this class was generated from the following file: