Passed
Pull Request — master (#7)
by Alex
12:47
created

DateTimeFactoryFactoryTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateWillReturnADateTimeFactory() 0 5 1
A testImplementsFactoryInterface() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ArpTest\DateTime\Factory;
6
7
use Arp\DateTime\DateTimeFactory;
8
use Arp\DateTime\Factory\DateTimeFactoryFactory;
9
use Arp\Factory\FactoryInterface;
10
use PHPUnit\Framework\TestCase;
11
12
/**
13
 * @covers \Arp\DateTime\Factory\DateTimeFactoryFactory
14
 *
15
 * @author  Alex Patterson <[email protected]>
16
 * @package ArpTest\DateTime\Factory
17
 */
18
final class DateTimeFactoryFactoryTest extends TestCase
19
{
20
    /**
21
     * Assert that the factory implements FactoryInterface.
22
     */
23
    public function testImplementsFactoryInterface(): void
24
    {
25
        $factory = new DateTimeFactoryFactory();
26
27
        $this->assertInstanceOf(FactoryInterface::class, $factory);
28
    }
29
30
    /**
31
     * Assert that the factory will return a DateTimeFactory instance when calling create().
32
     */
33
    public function testCreateWillReturnADateTimeFactory(): void
34
    {
35
        $factory = new DateTimeFactoryFactory();
36
37
        $this->assertInstanceOf(DateTimeFactory::class, $factory->create());
38
    }
39
}
40