1 | <?php |
||
15 | class FieldTitleMapperTest extends \PHPUnit_Framework_TestCase |
||
16 | { |
||
17 | /** |
||
18 | * @dataProvider mapData |
||
19 | * |
||
20 | * @param string $name field name form of string |
||
21 | * @param string $expected expected form of string |
||
22 | * |
||
23 | * @return void |
||
24 | */ |
||
25 | public function testMap($name, $expected) |
||
26 | { |
||
27 | $sut = new FieldTitleMapper; |
||
28 | |||
29 | $field = [ |
||
30 | 'fieldName' => $name |
||
31 | ]; |
||
32 | $expected = [ |
||
33 | 'fieldName' => $name, |
||
34 | 'title' => $expected |
||
35 | ]; |
||
36 | $this->assertEquals($expected, $sut->map($field)); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @return array |
||
|
|||
41 | */ |
||
42 | public function mapData() |
||
51 | } |
||
52 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.