Completed
Push — master ( b8cef5...721123 )
by Korotkov
07:49 queued 06:10
created

RegistryTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testSetDataException() 0 4 1
A testRegistry() 0 4 1
A testGetDataException() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author    : Korotkov Danila <[email protected]>
7
 * @license   https://mit-license.org/ MIT
8
 */
9
10
namespace Structural\Registry\Tests;
11
12
use Structural\Registry\Registry;
13
use PHPUnit\Framework\TestCase as PHPUnit_Framework_TestCase;
14
15
/**
16
 * Class RegistryTest
17
 * @package Structural\Registry\Tests
18
 */
19
class RegistryTest extends PHPUnit_Framework_TestCase
20
{
21
22
    public function testRegistry()
23
    {
24
        Registry::setData('stdClass', new \stdClass());
25
        $this->assertInstanceOf(\stdClass::class, Registry::getData('stdClass'));
26
    }
27
28
    public function testSetDataException()
29
    {
30
        $this->expectException(\InvalidArgumentException::class);
31
        Registry::setData('StdClass', new \stdClass());
32
    } // @codeCoverageIgnore
33
34
    public function testGetDataException()
35
    {
36
        $this->expectException(\InvalidArgumentException::class);
37
        Registry::getData('StdClass');
38
    } // @codeCoverageIgnore
39
}
40