Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 10 |
Lines | 13 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
33 | View Code Duplication | function testSaveSucceedsWithValidValues() |
|
34 | { |
||
35 | $site = new CMS_Site($this->kernel); |
||
36 | $site_array = array( |
||
37 | 'name' => 'Tester', |
||
38 | 'url' => 'http://localhost/', |
||
39 | 'cc_license' => '1' |
||
40 | ); |
||
41 | $site->save($site_array); |
||
42 | $this->assertEquals($site_array['name'], $site->get('name')); |
||
43 | $this->assertEquals($site_array['url'], $site->get('url')); |
||
44 | $this->assertEquals($site_array['cc_license'], $site->get('cc_license')); |
||
45 | } |
||
46 | } |
||
47 |
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: