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

Skip to content

Commit 8675569

Browse files
committed
Organised classes used by tests
1 parent 5ec77f2 commit 8675569

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
class example_child_class extends example_class {
6+
7+
protected $example_child_string_property;
8+
9+
public function __construct() {
10+
$this->example_child_string_property = uniqid();
11+
12+
parent::__construct();
13+
}
14+
15+
}

tests/example_classes.php renamed to tests/test_classes/example_class.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,3 @@ public function get_value($property_name) {
2525
}
2626

2727
}
28-
29-
class example_child_class extends example_class {
30-
31-
protected $example_child_string_property;
32-
33-
public function __construct() {
34-
$this->example_child_string_property = uniqid();
35-
36-
parent::__construct();
37-
}
38-
39-
}

tests/utils/ReflectionTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
use betterphp\utils\reflection;
88

9-
include_once __DIR__ . '/../example_classes.php';
9+
include_once __DIR__ . '/../test_classes/example_class.php';
10+
include_once __DIR__ . '/../test_classes/example_child_class.php';
1011

1112
/**
1213
* @covers \betterphp\utils\reflection
@@ -57,6 +58,7 @@ public function testGetPropertyFromChild(string $property_name, string $expected
5758

5859
public function dataGetPropertyFromChild(): array {
5960
return array_merge(
61+
// Same values as the parent and then the one for the child
6062
$this->dataGetProperty(),
6163
[
6264
['example_child_string_property', 'string'],

0 commit comments

Comments
 (0)