Completed
Pull Request — master (#2)
by Siwapun
13:33
created

FactoryTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testFactoryMustReturnCorrectObjectType() 0 5 1
A testFactoryMustAlwaysReturnNewObject() 0 6 1
1
<?php
2
namespace Aerophant\RamdaTest;
3
4
use function Aerophant\Ramda\factory;
5
use Aerophant\RamdaTest\Asset\PlainObjectAsset;
6
use PHPUnit\Framework\TestCase;
7
8
class FactoryTest extends TestCase
9
{
10
11
  public function testFactoryMustReturnCorrectObjectType()
12
  {
13
    $factory = factory(PlainObjectAsset::class);
14
    $obj = $factory();
15
    $this->assertInstanceOf(PlainObjectAsset::class, $obj);
16
  }
17
18
  public function testFactoryMustAlwaysReturnNewObject()
19
  {
20
    $factory = factory(PlainObjectAsset::class);
21
    $obj1 = $factory();
22
    $obj2 = $factory();
23
    $this->assertNotSame($obj1, $obj2);
24
  }
25
}
26