Total Complexity | 2 |
Total Lines | 70 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class RecordFieldUnitTest extends TestCase |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * Method returns mock object of the custom field |
||
12 | * |
||
13 | * @return object mock object of the custom field |
||
14 | */ |
||
15 | protected function getFieldMock(): object |
||
16 | { |
||
17 | $mock = $this->getMockBuilder(RecordField::class) |
||
|
|||
18 | ->setConstructorArgs( |
||
19 | [ |
||
20 | [ |
||
21 | 'name' => 'name', |
||
22 | 'required' => 1, |
||
23 | 'disabled' => 1, |
||
24 | 'custom' => 1, |
||
25 | 'name-prefix' => 'prefix', |
||
26 | 'batch' => 1, |
||
27 | 'toggler' => 'toggler-name', |
||
28 | 'toggle-value' => 3, |
||
29 | 'bind-field' => 'id', |
||
30 | 'session-id' => 'sid', |
||
31 | 'remote-source' => 'http://ya.ru', |
||
32 | 'type' => 'remote', |
||
33 | 'layout' => [ |
||
34 | 'rows' => [ |
||
35 | [ |
||
36 | "remote" => [ |
||
37 | "width" => 10 |
||
38 | ] |
||
39 | ] |
||
40 | ] |
||
41 | ] |
||
42 | ], |
||
43 | '' |
||
44 | ]) |
||
45 | ->setMethods([ |
||
46 | 'getFields' |
||
47 | ]) |
||
48 | ->getMock(); |
||
49 | |||
50 | $mock->method('getFields')->willReturn( |
||
51 | [ |
||
52 | 'id' => [ |
||
53 | 'type' => 'integer' |
||
54 | ], |
||
55 | 'remote' => [ |
||
56 | 'type' => 'string', |
||
57 | 'title' => 'remote-title' |
||
58 | ] |
||
59 | ]); |
||
60 | |||
61 | return $mock; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * Testing constructor |
||
66 | */ |
||
67 | public function testConstructor() |
||
77 | } |
||
78 | } |
||
79 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.