phpcs
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 47s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Successful in 1m4s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Successful in 1m5s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m4s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m5s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m4s
PHPUnit / PHPUnit – PHP 8.4 (pull_request) Successful in 1m6s
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 47s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Successful in 1m4s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Successful in 1m5s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m4s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m5s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m4s
PHPUnit / PHPUnit – PHP 8.4 (pull_request) Successful in 1m6s
This commit is contained in:
parent
b7747de5ac
commit
c55ce36499
2 changed files with 7 additions and 7 deletions
|
@ -266,7 +266,7 @@ class Event_Sources {
|
||||||
|
|
||||||
if ( $thumbnail_id ) {
|
if ( $thumbnail_id ) {
|
||||||
// Remove the thumbnail from the post.
|
// Remove the thumbnail from the post.
|
||||||
\delete_post_thumbnail( $post->post_id );
|
\delete_post_thumbnail( $post->post_id );
|
||||||
|
|
||||||
// Delete the attachment (and its files) from the media library.
|
// Delete the attachment (and its files) from the media library.
|
||||||
if ( self::is_attachment_featured_image( $thumbnail_id ) ) {
|
if ( self::is_attachment_featured_image( $thumbnail_id ) ) {
|
||||||
|
@ -274,7 +274,7 @@ class Event_Sources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
\wp_delete_post( $post->post_id , true );
|
\wp_delete_post( $post->post_id, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up the query.
|
// Clean up the query.
|
||||||
|
|
|
@ -353,13 +353,13 @@ class Test_Event_Sources extends \WP_UnitTestCase {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
$request = new WP_REST_Request( 'POST', '/activitypub/1.0/users/0/inbox' );
|
$request = new WP_REST_Request( 'POST', '/activitypub/1.0/users/0/inbox' );
|
||||||
$request->set_header( 'Content-Type', 'application/activity+json' );
|
$request->set_header( 'Content-Type', 'application/activity+json' );
|
||||||
$request->set_body( \wp_json_encode( $json ) );
|
$request->set_body( \wp_json_encode( $json ) );
|
||||||
$response = \rest_do_request( $request );
|
$response = \rest_do_request( $request );
|
||||||
$this->assertEquals( 202, $response->get_status() );
|
$this->assertEquals( 202, $response->get_status() );
|
||||||
|
|
||||||
$the_query = $event_query->get_upcoming_events();
|
$the_query = $event_query->get_upcoming_events();
|
||||||
$this->assertEquals( 1, $the_query->post_count );
|
$this->assertEquals( 1, $the_query->post_count );
|
||||||
|
|
||||||
// Second event of first organizer.
|
// Second event of first organizer.
|
||||||
|
@ -371,8 +371,8 @@ class Test_Event_Sources extends \WP_UnitTestCase {
|
||||||
'id' => 'https://remote.example/@organizer/events/birthday-party',
|
'id' => 'https://remote.example/@organizer/events/birthday-party',
|
||||||
'type' => 'Event',
|
'type' => 'Event',
|
||||||
'name' => 'Fediverse Party',
|
'name' => 'Fediverse Party',
|
||||||
'startTime' => \gmdate( 'Y-m-d\TH:i:s\Z', time() + 2* WEEK_IN_SECONDS ),
|
'startTime' => \gmdate( 'Y-m-d\TH:i:s\Z', time() + 2 * WEEK_IN_SECONDS ),
|
||||||
'endTime' => \gmdate( 'Y-m-d\TH:i:s\Z', time() + 2* WEEK_IN_SECONDS + HOUR_IN_SECONDS ),
|
'endTime' => \gmdate( 'Y-m-d\TH:i:s\Z', time() + 2 * WEEK_IN_SECONDS + HOUR_IN_SECONDS ),
|
||||||
'to' => 'https://www.w3.org/ns/activitystreams#Public',
|
'to' => 'https://www.w3.org/ns/activitystreams#Public',
|
||||||
'published' => '2020-01-01T00:00:00Z',
|
'published' => '2020-01-01T00:00:00Z',
|
||||||
),
|
),
|
||||||
|
@ -408,7 +408,7 @@ class Test_Event_Sources extends \WP_UnitTestCase {
|
||||||
$result = \Event_Bridge_For_ActivityPub\ActivityPub\Collection\Event_Sources::remove_event_source( 'https://remote.example/@organizer' );
|
$result = \Event_Bridge_For_ActivityPub\ActivityPub\Collection\Event_Sources::remove_event_source( 'https://remote.example/@organizer' );
|
||||||
|
|
||||||
// Verify that event posts got deleted.
|
// Verify that event posts got deleted.
|
||||||
$the_query = $event_query->get_upcoming_events();
|
$the_query = $event_query->get_upcoming_events();
|
||||||
$this->assertEquals( 1, $the_query->post_count );
|
$this->assertEquals( 1, $the_query->post_count );
|
||||||
|
|
||||||
\remove_filter( 'activitypub_defer_signature_verification', '__return_true' );
|
\remove_filter( 'activitypub_defer_signature_verification', '__return_true' );
|
||||||
|
|
Loading…
Reference in a new issue