Test Failed
Push — master ( 70433d...3ef8bc )
by Konrad
02:17
created

ElementMissingTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetContent() 0 4 1
A testEquals() 0 7 1
A testToString() 0 4 1
A testContains() 0 7 1
1
<?php
2
3
/**
4
 * @file This file is part of the PdfParser library.
5
 *
6
 * @author  Konrad Abicht <[email protected]>
7
 *
8
 * @date    2020-06-02
9
 *
10
 * @author  Sébastien MALOT <[email protected]>
11
 *
12
 * @date    2017-01-03
13
 *
14
 * @license LGPLv3
15
 *
16
 * @url     <https://github.com/smalot/pdfparser>
17
 *
18
 *  PdfParser is a pdf library written in PHP, extraction oriented.
19
 *  Copyright (C) 2017 - Sébastien MALOT <[email protected]>
20
 *
21
 *  This program is free software: you can redistribute it and/or modify
22
 *  it under the terms of the GNU Lesser General Public License as published by
23
 *  the Free Software Foundation, either version 3 of the License, or
24
 *  (at your option) any later version.
25
 *
26
 *  This program is distributed in the hope that it will be useful,
27
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
28
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29
 *  GNU Lesser General Public License for more details.
30
 *
31
 *  You should have received a copy of the GNU Lesser General Public License
32
 *  along with this program.
33
 *  If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>.
34
 */
35
36
namespace PHPUnitTests\Integration\Element;
37
38
use PHPUnitTests\TestCase;
39
use Smalot\PdfParser\Element\ElementMissing;
40
41
class ElementMissingTest extends TestCase
42
{
43
    public function testEquals(): void
44
    {
45
        $element = new ElementMissing();
46
        $this->assertFalse($element->equals(null));
47
        $this->assertFalse($element->equals(true));
48
        $this->assertFalse($element->equals('A'));
49
        $this->assertFalse($element->equals(false));
50
    }
51
52
    public function testGetContent(): void
53
    {
54
        $element = new ElementMissing();
55
        $this->assertFalse($element->getContent());
56
    }
57
58
    public function testContains(): void
59
    {
60
        $element = new ElementMissing();
61
        $this->assertFalse($element->contains(null));
62
        $this->assertFalse($element->contains(true));
63
        $this->assertFalse($element->contains('A'));
64
        $this->assertFalse($element->contains(false));
65
    }
66
67
    public function testToString(): void
68
    {
69
        $element = new ElementMissing();
70
        $this->assertEquals('', (string) $element);
71
    }
72
}
73