Passed
Push — main ( 07d383...18364d )
by Osvaldo
11:07
created

FactoryTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
namespace test;
4
5
use src\Factory;
6
use Exception;
7
use \PHPUnit\Framework\TestCase;
8
9
class FactoryTest extends TestCase
10
{
11
    public function setUp(): void
12
    {
13
        $this->class = new Factory();
0 ignored issues
show
Bug Best Practice introduced by
The property class does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
14
    }
15
16
    public function testSiLaClaseNoExisteSeEsperaUnaExcepcion()
17
    {
18
        $this->expectException(Exception::class);
19
        $this->class->crear('Hola', array('hola'));
20
    }
21
22
    public function testLaClaseDevuelveUnObjeto()
23
    {
24
        $this->assertIsObject($this->class->crear('test\Dummy', array() ) );
25
    }
26
}