Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa484ce

Browse files
committed
Made properties of test classes private, allows parent resolution to be tested
1 parent 8675569 commit aa484ce

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

tests/test_classes/example_child_class.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,23 @@
44

55
class example_child_class extends example_class {
66

7-
protected $example_child_string_property;
7+
private $example_child_string_property;
88

99
public function __construct() {
1010
$this->example_child_string_property = uniqid();
1111

1212
parent::__construct();
1313
}
1414

15+
/**
16+
* @inheritDoc
17+
*/
18+
public function get_value($property_name) {
19+
if (!isset($this->{$property_name})) {
20+
return parent::get_value($property_name);
21+
} else {
22+
return $this->{$property_name};
23+
}
24+
}
25+
1526
}

tests/test_classes/example_class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
class example_class {
66

7-
protected $example_string_property;
8-
protected $example_array_property;
7+
private $example_string_property;
8+
private $example_array_property;
99

1010
public function __construct() {
1111
$this->example_string_property = uniqid();

0 commit comments

Comments
 (0)