Passed
Push — main ( f3cfb1...17781b )
by Emil
04:34
created

ProductTest::testSetAndGetMethods()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Tests\Entity;
4
5
use PHPUnit\Framework\TestCase;
6
use App\Entity\Product;
7
8
/**
9
 * Test cases for class Product.
10
 */
11
class ProductTest extends TestCase
12
{
13
    /**
14
     * testCreateObject
15
     *
16
     * Construct object and verify that the object has the expected
17
     * properties, use no arguments.
18
     *
19
     * @return void
20
     */
21
    public function testCreateObject(): void
22
    {
23
        $product = new Product();
24
        $this->assertInstanceOf(Product::class, $product);
25
    }
26
27
    /**
28
     * testSetAndGetMethods
29
     *
30
     * Test the set and get methods
31
     *
32
     * @return void
33
     */
34
    public function testSetAndGetMethods(): void
35
    {
36
        $product = new Product();
37
        $product->setName("Test");
38
        $product->setValue(69);
39
40
        $this->assertNull($product->getId());
41
        $this->assertEquals("Test", $product->getName());
42
        $this->assertEquals(69, $product->getValue());
43
    }
44
}
45