mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 21:08:44 +01:00
Tests: Add missing @covers
tags for files in phpunit/tests/editor/
.
Props patopaiar, jrf. See #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@50288 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c49e14bd7b
commit
f184ef4b6c
@ -8,26 +8,19 @@ if ( ! class_exists( '_WP_Editors', false ) ) {
|
||||
* @group editor
|
||||
*/
|
||||
class Tests_WP_Editors extends WP_UnitTestCase {
|
||||
public function wp_link_query_callback( $results ) {
|
||||
return array_merge(
|
||||
$results,
|
||||
array(
|
||||
array(
|
||||
'ID' => 123,
|
||||
'title' => 'foo',
|
||||
'permalink' => 'bar',
|
||||
'info' => 'baz',
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers _WP_Editors::wp_link_query
|
||||
*/
|
||||
public function test_wp_link_query_returns_false_when_nothing_found() {
|
||||
$actual = _WP_Editors::wp_link_query( array( 's' => 'foobarbaz' ) );
|
||||
|
||||
$this->assertFalse( $actual );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers _WP_Editors::wp_link_query
|
||||
*/
|
||||
public function test_wp_link_query_returns_search_results() {
|
||||
$post = self::factory()->post->create_and_get( array( 'post_status' => 'publish' ) );
|
||||
$actual = _WP_Editors::wp_link_query( array( 's' => $post->post_title ) );
|
||||
@ -47,6 +40,8 @@ class Tests_WP_Editors extends WP_UnitTestCase {
|
||||
|
||||
/**
|
||||
* @ticket 41825
|
||||
*
|
||||
* @covers _WP_Editors::wp_link_query
|
||||
*/
|
||||
public function test_wp_link_query_returns_filtered_result_when_nothing_found() {
|
||||
add_filter( 'wp_link_query', array( $this, 'wp_link_query_callback' ) );
|
||||
@ -66,6 +61,9 @@ class Tests_WP_Editors extends WP_UnitTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers _WP_Editors::wp_link_query
|
||||
*/
|
||||
public function test_wp_link_query_returns_filtered_search_results() {
|
||||
$post = self::factory()->post->create_and_get( array( 'post_status' => 'publish' ) );
|
||||
|
||||
@ -91,4 +89,18 @@ class Tests_WP_Editors extends WP_UnitTestCase {
|
||||
$actual
|
||||
);
|
||||
}
|
||||
|
||||
public function wp_link_query_callback( $results ) {
|
||||
return array_merge(
|
||||
$results,
|
||||
array(
|
||||
array(
|
||||
'ID' => 123,
|
||||
'title' => 'foo',
|
||||
'permalink' => 'bar',
|
||||
'info' => 'baz',
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user