Conditions | 1 |
Paths | 1 |
Total Lines | 28 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
16 | public function testLog() |
||
17 | { |
||
18 | $called = false; |
||
19 | $l = new LoggerListener( |
||
20 | $m = $this->getMock(LoggerInterface::class) |
||
21 | ); |
||
22 | $m |
||
23 | ->method('info') |
||
24 | ->will($this->returnCallback(function($message, $context) use (&$called) { |
||
25 | $called = true; |
||
26 | $this->assertSame('Cypher query about to be executed', $message); |
||
27 | $this->assertSame('foo', $context['cypher']); |
||
28 | $this->assertSame( |
||
29 | ['bar' => 'baz'], |
||
30 | $context['parameters'] |
||
31 | ); |
||
32 | })); |
||
33 | $this->assertSame( |
||
34 | null, |
||
35 | $l->log( |
||
36 | new PreQueryEvent( |
||
37 | (new Cypher('foo')) |
||
38 | ->withParameter('bar', 'baz') |
||
39 | ) |
||
40 | ) |
||
41 | ); |
||
42 | $this->assertTrue($called); |
||
43 | } |
||
44 | |||
53 |