Passed
Push — master ( d5232f...8b0585 )
by Dmitriy
03:41 queued 46s
created

HttpStreamProxyTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 15
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testRegisteredTwice() 0 8 1
A tearDown() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Tests\Unit\Collector\Stream;
6
7
use PHPUnit\Framework\TestCase;
8
use Yiisoft\Yii\Debug\Collector\Stream\HttpStreamProxy;
9
10
final class HttpStreamProxyTest extends TestCase
11
{
12
    protected function tearDown(): void
13
    {
14
        HttpStreamProxy::unregister();
15
    }
16
17
    public function testRegisteredTwice()
18
    {
19
        HttpStreamProxy::unregister();
20
        $this->assertFalse(HttpStreamProxy::$registered);
21
        HttpStreamProxy::register();
22
        $this->assertTrue(HttpStreamProxy::$registered);
23
        HttpStreamProxy::register();
24
        $this->assertTrue(HttpStreamProxy::$registered);
25
    }
26
}
27