From df8c9b16788bd858a730a27b758c2daf39d6f02e Mon Sep 17 00:00:00 2001 From: Andrey Savchenko Date: Fri, 28 Dec 2018 15:02:52 +0200 Subject: [PATCH] Added closure and anonymous class to hook formatter test. --- tests/Formatter/HookTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/Formatter/HookTest.php b/tests/Formatter/HookTest.php index 0560169..2798e26 100644 --- a/tests/Formatter/HookTest.php +++ b/tests/Formatter/HookTest.php @@ -44,12 +44,16 @@ class HookTest extends LapsTestCase { $hook = [ [ [ 'function' => 'function', 'accepted_args' => 2 ] ], [ [ 'function' => [ 'class', 'method' ], 'accepted_args' => 1 ] ], + [ [ 'function' => function() {}, 'accepted_args' => 1 ] ], + [ [ 'function' => new class(){}, 'accepted_args' => 1 ] ], ]; $result = $formatter->format( $hook ); $this->assertInternalType( 'array', $result ); - $this->assertArraySubset( [ 'function(2)', 'class::method' ], array_values( $result ) ); + $this->assertArraySubset( [ 'function(2)', 'class::method' ], $result ); + $this->assertStringStartsWith( 'closure from', $result[2] ); + $this->assertStringStartsWith( 'anonymous class from', $result[3] ); } }