Test Failed
Push — main ( 49ffe2...63a966 )
by Vedrana
07:24 queued 02:15
created

LibraryTest   A

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
7
use App\Entity\Library;
8
9
/**
10
 * Test cases for the Library entity.
11
 */
12
class LibraryTest extends TestCase
13
{
14
    /**
15
     * Test set and get.
16
     */
17
    public function testLibraryEntity(): void
18
    {
19
        $library = new Library();
20
21
        // Test values
22
        $id = 1;
23
        $title = "Hard-Boiled Wonderland and the End of the World";
24
        $author = "Haruki Murakami";
25
        $isbn = "9780099448785";
26
        $bookcover = "murakami.jpg";
27
28
        // Set values
29
        $library->setId($id);
30
        $library->setTitle($title);
31
        $library->setAuthor($author);
32
        $library->setIsbn($isbn);
33
        $library->setBookcover($bookcover);
34
35
        // Assert values
36
        $this->assertEquals($id, $library->getId());
37
        $this->assertEquals($title, $library->getTitle());
38
        $this->assertEquals($author, $library->getAuthor());
39
        $this->assertEquals($isbn, $library->getIsbn());
40
        $this->assertEquals($bookcover, $library->getBookcover());
41
    }
42
}
43