| Conditions | 1 |
| Paths | 1 |
| Total Lines | 33 |
| Code Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | public function setUp() |
||
| 6 | { |
||
| 7 | parent::setUp(); |
||
| 8 | |||
| 9 | $this->view = app('DaveJamesMiller\Breadcrumbs\View'); |
||
|
|
|||
| 10 | |||
| 11 | $this->breadcrumbs = [ |
||
| 12 | (object) [ |
||
| 13 | 'title' => 'Home', |
||
| 14 | 'url' => '/', |
||
| 15 | 'first' => true, |
||
| 16 | 'last' => false, |
||
| 17 | ], |
||
| 18 | (object) [ |
||
| 19 | 'title' => 'Not a link', |
||
| 20 | 'url' => null, // Test non-links |
||
| 21 | 'first' => false, |
||
| 22 | 'last' => false, |
||
| 23 | ], |
||
| 24 | (object) [ |
||
| 25 | 'title' => 'Blog & < >', // Test HTML escaping |
||
| 26 | 'url' => '/blog', |
||
| 27 | 'first' => false, |
||
| 28 | 'last' => false, |
||
| 29 | ], |
||
| 30 | (object) [ |
||
| 31 | 'title' => 'Sample Post', |
||
| 32 | 'url' => '/blog/123', |
||
| 33 | 'first' => false, |
||
| 34 | 'last' => true, |
||
| 35 | ], |
||
| 36 | ]; |
||
| 37 | } |
||
| 38 | |||
| 52 |
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: