1 | <?php |
||
20 | class CrudEditActionTest extends TestCase |
||
21 | { |
||
22 | |||
23 | use ConfigTrait; |
||
24 | use FixturesTrait; |
||
25 | |||
26 | /** |
||
27 | * @var CrudEditAction |
||
28 | */ |
||
29 | public $Action; |
||
30 | |||
31 | /** |
||
32 | * setUp method |
||
33 | * |
||
34 | * @return void |
||
35 | */ |
||
36 | public function setUp() |
||
40 | |||
41 | /** |
||
42 | * tearDown method |
||
43 | * |
||
44 | * @return void |
||
45 | */ |
||
46 | public function tearDown() |
||
52 | |||
53 | /** |
||
54 | * Test load value method |
||
55 | * |
||
56 | * @return void |
||
57 | */ |
||
58 | public function testExecuteSuccess() |
||
73 | |||
74 | /** |
||
75 | * Test load value method |
||
76 | * |
||
77 | * @return void |
||
78 | * @expectedException \CakeDC\Api\Exception\ValidationException |
||
79 | */ |
||
80 | public function testExecuteValidationError() |
||
89 | |||
90 | /** |
||
91 | * Test load value method |
||
92 | * |
||
93 | * @return void |
||
94 | * @expectedException \Cake\Datasource\Exception\RecordNotFoundException |
||
95 | */ |
||
96 | public function testExecuteNotFound() |
||
103 | |||
104 | protected function _initializeAction($id, $post = []) |
||
129 | } |
||
130 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: