diff --git a/tests/phpunit/includes/export-testcase.php b/tests/phpunit/includes/export-testcase.php index 235e956..d74bf9f 100644 --- a/tests/phpunit/includes/export-testcase.php +++ b/tests/phpunit/includes/export-testcase.php @@ -59,7 +59,13 @@ protected function assertEntityContains( $entity, $type, $expected ) { foreach ( $entity[ $type ] as $exported ) { if ( $exported['line'] == $expected['line'] ) { foreach ( $expected as $key => $expected_value ) { - $this->assertEquals( $expected_value, $exported[ $key ] ); + if ( isset( $exported[ $key ] ) ) { + $exported_value = $exported[ $key ]; + } else { + $exported_value = _wp_array_get( $exported, explode( '.', $key ), null ); + } + + $this->assertEquals( $expected_value, $exported_value ); } return; diff --git a/tests/phpunit/tests/export/hooks.inc b/tests/phpunit/tests/export/hooks.inc index 3cc11f4..54cf8f8 100644 --- a/tests/phpunit/tests/export/hooks.inc +++ b/tests/phpunit/tests/export/hooks.inc @@ -5,3 +5,4 @@ do_action( "action_with_double_quotes" ); do_action( $variable . '-action' ); do_action( "another-{$variable}-action" ); do_action( 'hook_' . $object->property . '_pre' ); +apply_filters( 'plain_filter', $variable, $filter_context ); diff --git a/tests/phpunit/tests/export/hooks.php b/tests/phpunit/tests/export/hooks.php index adf4ef8..cf9d608 100644 --- a/tests/phpunit/tests/export/hooks.php +++ b/tests/phpunit/tests/export/hooks.php @@ -35,5 +35,15 @@ public function test_hook_names_standardized() { $this->assertFileContainsHook( array( 'name' => 'hook_{$object->property}_pre', 'line' => 7 ) ); + + $this->assertFileContainsHook( + array( + 'type' => 'filter', + 'name' => 'plain_filter', + 'line' => 8, + 'arguments.0' => '$variable', + 'arguments.1' => '$filter_context' + ) + ); } }