Test Setup Failed
Branch master (17e5cc)
by Gaetano
02:18
created

MainTest::testMainClassCannotBeInstantiated()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace skrtdev\PrototypesTests;
4
5
use skrtdev\Prototypes\Exception;
6
use skrtdev\Prototypes\Prototypes;
7
use PHPUnit\Framework\TestCase;
8
use stdClass;
9
10
class MainTest extends TestCase
11
{
12
    public function testNonExistentClass(): void
13
    {
14
        $this->expectException(Exception::class);
15
        Prototypes::addClassMethod('RandomClass', 'RandomMethod', fn() => true);
16
    }
17
18
    public function testNonPrototypeableClass(): void
19
    {
20
        $this->expectException(Exception::class);
21
        Prototypes::addClassMethod(stdClass::class, 'RandomMethod', fn() => true);
22
    }
23
24
    public function testMainClassCannotBeInstantiated(): void
25
    {
26
        $this->expectException(Exception::class);
27
        $_ = new Prototypes();
0 ignored issues
show
Unused Code introduced by
The assignment to $_ is dead and can be removed.
Loading history...
28
    }
29
}
30