Completed
Pull Request — master (#4)
by Siwapun
13:03
created

testFactoryMustAlwaysReturnNewObject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace Aerophant\RamdaTest;
3
4
use function Aerophant\Ramda\construct;
5
use Aerophant\RamdaTest\Asset\PlainObjectAsset;
6
use PHPUnit\Framework\TestCase;
7
8
class ConstructTest extends TestCase
9
{
10
11
  public function testFactoryMustReturnCorrectObjectType()
12
  {
13
    $construct = construct()(PlainObjectAsset::class);
14
    $obj = $construct();
15
    $this->assertInstanceOf(PlainObjectAsset::class, $obj);
16
  }
17
18
  public function testFactoryMustAlwaysReturnNewObject()
19
  {
20
    $construct = construct()(PlainObjectAsset::class);
21
    $obj1 = $construct();
22
    $obj2 = $construct();
23
    $this->assertNotSame($obj1, $obj2);
24
  }
25
}
26