Passed
Push — master ( af3dcf...3709c1 )
by Petr
02:16
created

VolumeTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 1
1
<?php
2
3
namespace EntriesSourceTests;
4
5
6
use kalanis\kw_menu\EntriesSource;
7
use kalanis\kw_menu\MenuException;
8
use kalanis\kw_paths\PathsException;
9
10
11
class VolumeTest extends \CommonTestClass
12
{
13
    /**
14
     * @throws MenuException
15
     * @throws PathsException
16
     */
17
    public function testGetFiles(): void
18
    {
19
        $lib = new EntriesSource\Volume($this->getTargetPath());
20
        $iter = $lib->getFiles([]);
21
        $files = iterator_to_array($iter);
22
        $this->assertNotEmpty($files);
23
        $this->assertTrue(in_array('dummy4.htm', $files));
24
        $this->assertFalse(in_array('dummy5.htm', $files));
25
26
        $iter2 = $lib->getFiles(['dummy3']);
27
        $files2 = iterator_to_array($iter2);
28
        $this->assertFalse(in_array('dummy4.htm', $files2));
29
        $this->assertTrue(in_array('dummy5.htm', $files2));
30
    }
31
}
32