test_getBuilds_default()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 18
rs 9.9
c 0
b 0
f 0
1
<?php
2
3
namespace ByTIC\Assets\Tests\Encore;
4
5
use ByTIC\Assets\Encore\EntrypointLookupFactory;
6
use ByTIC\Assets\Tests\AbstractTest;
7
use Symfony\WebpackEncoreBundle\Asset\EntrypointLookup;
8
9
/**
10
 * Class EntrypointLookupFactoryTest
11
 * @package ByTIC\Assets\Tests\Encore
12
 */
13
class EntrypointLookupFactoryTest extends AbstractTest
14
{
15
    public function test_getBuilds_default()
16
    {
17
        EntrypointLookupFactory::setConfig([
18
            'assets' => [
19
                'output_path' => TEST_FIXTURE_PATH.'/build/',
20
            ],
21
        ]);
22
23
        $builds = EntrypointLookupFactory::getBuilds();
24
        self::assertIsArray($builds);
25
        self::assertCount(1, $builds);
26
        self::assertArrayHasKey('_default', $builds);
27
28
        $entrypoint = $builds['_default'];
29
        self::assertInstanceOf(EntrypointLookup::class, $entrypoint);
30
31
        $jsFiles = $entrypoint->getJavaScriptFiles('my_entry');
32
        self::assertSame(['build/file1.js', 'build/file2.js'], $jsFiles);
33
    }
34
}
35