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

CallbackPromiseTest::testCallbackPromise()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 1
nop 0
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