Completed
Pull Request — master (#367)
by
unknown
02:39 queued 01:14
created

CallbackPromiseTest::testCallbackPromise()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace Tests\Prophecy\Promise;
4
5
/**
6
 * @internal
7
 */
8
final class CallbackPromiseTest extends \PHPUnit_Framework_TestCase
9
{
10
    public function testCallbackPromise()
11
    {
12
        $fixer = $this->prophesize('Tests\Prophecy\Promise\CallbackPromiseTestDummy');
13
        $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...
14
            return $things
15
                ? 'yes'
16
                : 'no'
17
            ;
18
        });
19
20
        $this->assertSame('no', $fixer->reveal()->getName());
21
    }
22
}
23
24
class CallbackPromiseTestDummy
25
{
26
    public function getName() {
27
        return 'dummy';
28
    }
29
}
30