LibraryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testLibraryEntity() 0 24 1
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