Completed
Pull Request — master (#367)
by
unknown
01:28
created

CallbackPromiseTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCallbackPromise() 0 14 2
1
<?php
2
3
namespace Tests\Prophecy\Promise;
4
5
/**
6
 * @requires PHP 5.5
7
 *
8
 * @internal
9
 */
10
final class CallbackPromiseTest extends \PHPUnit_Framework_TestCase
11
{
12
    public function testCallbackPromise()
13
    {
14
        $things = false;
15
16
        $fixer = $this->prophesize(CallbackPromiseTestDummy::class);
17
        $fixer->getName()->will(static function (array $arguments) use (&$things) {
0 ignored issues
show
Unused Code introduced by
The parameter $arguments is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
            return $things
19
                ? 'yes'
20
                : 'no'
21
            ;
22
        });
23
24
        $this->assertSame('no', $fixer->reveal()->getName());
25
    }
26
}
27
28
class CallbackPromiseTestDummy
29
{
30
    public function getName() {
31
        return 'dummy';
32
    }
33
}
34