PipelineFactoryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_creates_a_pipeline_with_the_given_series_of_stages() 0 15 1
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