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

LibraryTest::testLibraryEntity()   A

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
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