GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 4.2-to-master ( ed215f )
by E
06:47
created

ThemeResourcesTest::testCopyToDestination()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 16
nc 1
nop 0
dl 0
loc 25
rs 8.8571
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace ApiGen\Tests\Theme;
4
5
use ApiGen\Configuration\Configuration;
6
use ApiGen\Tests\ContainerFactory;
7
use ApiGen\Theme\ThemeResources;
8
use ApiGen\Utils\FileSystem;
9
use PHPUnit\Framework\TestCase;
10
11
final class ThemeResourcesTest extends TestCase
12
{
13
    /**
14
     * @var Configuration
15
     */
16
    private $configuration;
17
18
    protected function setUp(): void
19
    {
20
        $container = (new ContainerFactory)->create();
21
        $this->configuration = $container->getByType(Configuration::class);
22
    }
23
24
    public function testCopyToDestination(): void
25
    {
26
        $sourceDir = TEMP_DIR . '/source';
27
        $sourceFile = TEMP_DIR . '/other-source/other-file.txt';
28
        $destinationDir = TEMP_DIR . '/destination';
29
30
        $this->configuration->resolveOptions([
31
            'source' => [__DIR__],
32
            'destination' => __DIR__ . '/Destination',
33
            'template' => [
34
                'resources' => [
35
                    $sourceFile => 'other-file-renamed.txt',
36
                    $sourceDir => 'assets'
37
                ]
38
            ]
39
        ]);
40
41
        $this->prepareSources($sourceFile, $sourceDir);
42
43
        $themeResources = new ThemeResources($this->configuration, new FileSystem);
44
        $themeResources->copyToDestination($destinationDir);
45
46
        $this->assertFileExists($destinationDir . '/assets/file.txt');
47
        $this->assertFileExists($destinationDir . '/other-file-renamed.txt');
48
    }
49
50
    private function prepareSources(string $sourceFile, string $sourceDir): void
51
    {
52
        mkdir(dirname($sourceFile), 0777);
53
        file_put_contents($sourceFile, '...');
54
        mkdir($sourceDir, 0777);
55
        file_put_contents($sourceDir . '/file.txt', '...');
56
    }
57
}
58