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

testImplementsFactoryInterface()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
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