ProductTest::testInitialIdIsNull()   A
last analyzed

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
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace App\Tests\Entity;
4
5
use App\Entity\Product;
6
use PHPUnit\Framework\TestCase;
7
8
/**
9
 * Test cases for the Product entity.
10
 */
11
class ProductTest extends TestCase
12
{
13
    /**
14
     * Test set and get name.
15
     */
16
    public function testSetNameAndGetName(): void
17
    {
18
        $product = new Product();
19
        $product->setName("Test Product");
20
21
        $this->assertEquals("Test Product", $product->getName());
22
    }
23
24
    /**
25
     * Test set and get value.
26
     */
27
    public function testSetValueAndGetValue(): void
28
    {
29
        $product = new Product();
30
        $product->setValue(38);
31
32
        $this->assertEquals(38, $product->getValue());
33
    }
34
35
    /**
36
     * Test initial id is null.
37
     */
38
    public function testInitialIdIsNull(): void
39
    {
40
        $product = new Product();
41
42
        $this->assertNull($product->getId());
43
    }
44
}
45