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

RegistryTest::testSetDataException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
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