Added closure and anonymous class to hook formatter test.
This commit is contained in:
1 parent
5356df262f
commit
df8c9b1678
1 file changed
+5
-1
@@ -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] );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user