LibraryTest::testLibraryEntity()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 16
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 24
rs 9.7333
1
<?php
2
3
namespace App\Tests\Entity;
4
5
use PHPUnit\Framework\TestCase;
6
use App\Entity\Library;
7
8
/**
9
 * Test cases for the Library entity.
10
 */
11
class LibraryTest extends TestCase
12
{
13
    /**
14
     * Test set and get.
15
     */
16
    public function testLibraryEntity(): void
17
    {
18
        $library = new Library();
19
20
        // Test values
21
        $id = 1;
22
        $title = "Hard-Boiled Wonderland and the End of the World";
23
        $author = "Haruki Murakami";
24
        $isbn = "9780099448785";
25
        $bookcover = "murakami.jpg";
26
27
        // Set values
28
        $library->setId($id);
29
        $library->setTitle($title);
30
        $library->setAuthor($author);
31
        $library->setIsbn($isbn);
32
        $library->setBookcover($bookcover);
33
34
        // Assert values
35
        $this->assertEquals($id, $library->getId());
36
        $this->assertEquals($title, $library->getTitle());
37
        $this->assertEquals($author, $library->getAuthor());
38
        $this->assertEquals($isbn, $library->getIsbn());
39
        $this->assertEquals($bookcover, $library->getBookcover());
40
    }
41
}
42