test_creates_a_pipeline_with_the_given_series_of_stages()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application;
6
7
use phpDocumentor\Application\PipelineFactory;
8
9
final class PipelineFactoryTest extends \PHPUnit\Framework\TestCase
10
{
11
    public function test_creates_a_pipeline_with_the_given_series_of_stages(): void
12
    {
13
        $pipeline = PipelineFactory::create([
14
            function ($value) {
15
                return $value + 1;
16
            },
17
            function ($value) {
18
                return $value * 2;
19
            }
20
        ]);
21
22
        // can only test whether it worked by running the pipeline and
23
        // getting the expected output
24
        $this->assertSame(8, $pipeline(3));
25
    }
26
}
27