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

MainTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 18
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testNonExistentClass() 0 4 1
A testMainClassCannotBeInstantiated() 0 4 1
A testNonPrototypeableClass() 0 4 1
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