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 — master ( 75bdf9...8faa57 )
by joseph
83:56 queued 81:04
created

PipelineTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 42
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A itCanRegisterANewProcess() 0 7 1
A getPipeline() 0 3 1
A getRegisteredProcesses() 0 7 1
A itCanRunAProcessPipelineOnAFile() 0 10 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Tests\Small\CodeGeneration\Creation\Process;
4
5
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Process\Pipeline;
6
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Process\ReplaceNameProcess;
7
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Filesystem\Factory\FindReplaceFactory;
8
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Filesystem\File;
9
use PHPUnit\Framework\TestCase;
10
use ts\Reflection\ReflectionClass;
11
12
/**
13
 * @covers \EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Process\Pipeline
14
 * @small
15
 */
16
class PipelineTest extends TestCase
17
{
18
19
    /**
20
     * @test
21
     */
22
    public function itCanRegisterANewProcess()
23
    {
24
        $pipeline = $this->getPipeline();
25
        $process  = new ReplaceNameProcess();
26
        $pipeline->register($process);
27
        $processes = $this->getRegisteredProcesses($pipeline);
28
        self::assertSame([$process], $processes);
29
    }
30
31
    private function getPipeline(): Pipeline
32
    {
33
        return new Pipeline(new FindReplaceFactory());
34
    }
35
36
    private function getRegisteredProcesses(Pipeline $pipeline): array
37
    {
38
        $reflection = new ReflectionClass(\get_class($pipeline));
39
        $property   = $reflection->getProperty('processes');
40
        $property->setAccessible(true);
41
42
        return $property->getValue($pipeline);
43
    }
44
45
    /**
46
     * @test
47
     */
48
    public function itCanRunAProcessPipelineOnAFile()
49
    {
50
        $file = new File();
51
        $file->setContents('blah');
52
        $process = new ReplaceNameProcess();
53
        $process->setArgs('blah', 'foo');
54
        $this->getPipeline()->register($process)->run($file);
55
        $expected = 'foo';
56
        $actual   = $file->getContents();
57
        self::assertSame($expected, $actual);
58
    }
59
}
60