Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FieldNamerTest.php
Go to the documentation of this file.
1 <?php
7 
9 
13 class FieldNamerTest extends \PHPUnit\Framework\TestCase
14 {
18  private $model;
19 
23  protected function setUp()
24  {
25  $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
26  $this->model = $objectManager->getObject(\Magento\Framework\Reflection\FieldNamer::class);
27  }
28 
34  public function testGetFieldNameForMethodName($methodName, $expectedName)
35  {
36  $value = $this->model->getFieldNameForMethodName($methodName);
37  $this->assertEquals($value, $expectedName);
38  }
39 
43  public function methodNameProvider()
44  {
45  return [
46  'isMethod' => ['isValid', 'valid'],
47  'getMethod' => ['getValue', 'value'],
48  'hasMethod' => ['hasStuff', 'stuff'],
49  'randomMethod' => ['randomMethod', null],
50  ];
51  }
52 }
$objectManager
Definition: bootstrap.php:17
$value
Definition: gender.phtml:16