Skip to content
This repository was archived by the owner on Dec 22, 2025. It is now read-only.

Commit 6a24af6

Browse files
committed
Do not test protected methods
1 parent 694bd92 commit 6a24af6

File tree

4 files changed

+0
-47
lines changed

4 files changed

+0
-47
lines changed

tests/Client/LogTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use HelloFresh\Stats\Bucket;
66
use HelloFresh\Stats\Bucket\MetricOperation;
77
use HelloFresh\Stats\Bucket\Plain;
8-
use HelloFresh\Stats\Incrementer;
98
use HelloFresh\Stats\State;
109
use PHPUnit\Framework\TestCase;
1110

@@ -23,16 +22,6 @@ public function testInstances()
2322

2423
$statsClient = new Log($logger);
2524
$this->assertInstanceOf(Stats\Timer\Log::class, $statsClient->buildTimer());
26-
27-
$reflection = new \ReflectionClass($statsClient);
28-
29-
$methodIncrementer = $reflection->getMethod('getIncrementer');
30-
$methodIncrementer->setAccessible(true);
31-
$this->assertInstanceOf(Incrementer\Log::class, $methodIncrementer->invoke($statsClient));
32-
33-
$methodState = $reflection->getMethod('getState');
34-
$methodState->setAccessible(true);
35-
$this->assertInstanceOf(State\Log::class, $methodState->invoke($statsClient));
3625
}
3726

3827
public function testTrackRequest()

tests/Client/MemoryTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
use HelloFresh\Stats;
55
use HelloFresh\Stats\Bucket;
6-
use HelloFresh\Stats\Incrementer;
7-
use HelloFresh\Stats\State;
86
use PHPUnit\Framework\TestCase;
97

108
class MemoryTest extends TestCase
@@ -18,16 +16,6 @@ public function testInstances()
1816
{
1917
$statsClient = new Memory();
2018
$this->assertInstanceOf(Stats\Timer\Memory::class, $statsClient->buildTimer());
21-
22-
$reflection = new \ReflectionClass($statsClient);
23-
24-
$methodIncrementer = $reflection->getMethod('getIncrementer');
25-
$methodIncrementer->setAccessible(true);
26-
$this->assertInstanceOf(Incrementer\Memory::class, $methodIncrementer->invoke($statsClient));
27-
28-
$methodState = $reflection->getMethod('getState');
29-
$methodState->setAccessible(true);
30-
$this->assertInstanceOf(State\Memory::class, $methodState->invoke($statsClient));
3119
}
3220

3321
public function testHTTPRequestSection()

tests/Client/NoOpTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
use HelloFresh\Stats;
55
use HelloFresh\Stats\Bucket;
6-
use HelloFresh\Stats\Incrementer;
7-
use HelloFresh\Stats\State;
86
use PHPUnit\Framework\TestCase;
97

108
class NoOpTest extends TestCase
@@ -13,16 +11,6 @@ public function testInstances()
1311
{
1412
$statsClient = new NoOp();
1513
$this->assertInstanceOf(Stats\Timer\Memory::class, $statsClient->buildTimer());
16-
17-
$reflection = new \ReflectionClass($statsClient);
18-
19-
$methodIncrementer = $reflection->getMethod('getIncrementer');
20-
$methodIncrementer->setAccessible(true);
21-
$this->assertInstanceOf(Incrementer\NoOp::class, $methodIncrementer->invoke($statsClient));
22-
23-
$methodState = $reflection->getMethod('getState');
24-
$methodState->setAccessible(true);
25-
$this->assertInstanceOf(State\NoOp::class, $methodState->invoke($statsClient));
2614
}
2715

2816
public function testHTTPRequestSection()

tests/Client/StatsDTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
use HelloFresh\Stats;
55
use HelloFresh\Stats\Bucket;
6-
use HelloFresh\Stats\Incrementer;
7-
use HelloFresh\Stats\State;
86
use PHPUnit\Framework\TestCase;
97

108
class StatsDTest extends TestCase
@@ -42,16 +40,6 @@ public function testInstances()
4240

4341
$statsClient = new StatsD('statsd://');
4442
$this->assertInstanceOf(Stats\Timer\StatsD::class, $statsClient->buildTimer());
45-
46-
$reflection = new \ReflectionClass($statsClient);
47-
48-
$methodIncrementer = $reflection->getMethod('getIncrementer');
49-
$methodIncrementer->setAccessible(true);
50-
$this->assertInstanceOf(Incrementer\StatsD::class, $methodIncrementer->invoke($statsClient));
51-
52-
$methodState = $reflection->getMethod('getState');
53-
$methodState->setAccessible(true);
54-
$this->assertInstanceOf(State\StatsD::class, $methodState->invoke($statsClient));
5543
}
5644

5745
public function testHTTPRequestSection()

0 commit comments

Comments
 (0)