Passed
Pull Request — master (#7)
by Alex
07:24
created

DateIntervalFactoryFactoryTest   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 testCreateWillReturnDateIntervalFactory() 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\DateIntervalFactory;
8
use Arp\DateTime\Factory\DateIntervalFactoryFactory;
9
use Arp\Factory\FactoryInterface;
10
use PHPUnit\Framework\TestCase;
11
12
/**
13
 * @covers  \Arp\DateTime\Factory\DateIntervalFactoryFactory
14
 *
15
 * @author  Alex Patterson <[email protected]>
16
 * @package ArpTest\DateTime\Factory
17
 */
18
final class DateIntervalFactoryFactoryTest extends TestCase
19
{
20
    /**
21
     * Assert that the factory implements FactoryInterface
22
     */
23
    public function testImplementsFactoryInterface(): void
24
    {
25
        $factory = new DateIntervalFactoryFactory();
26
27
        $this->assertInstanceOf(FactoryInterface::class, $factory);
28
    }
29
30
    /**
31
     * Assert that a DateIntervalFactory is returned from calls to create()
32
     */
33
    public function testCreateWillReturnDateIntervalFactory(): void
34
    {
35
        $factory = new DateIntervalFactoryFactory();
36
37
        $this->assertInstanceOf(DateIntervalFactory::class, $factory->create());
38
    }
39
}
40