Skip to content

Commit 9141ed2

Browse files
committed
second pass
1 parent 4d1de94 commit 9141ed2

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

includes/activity/class-activity.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
* @method Activity set_attachment( array $attachment ) Sets the attachment property of the object.
5353
* @method Activity set_icon( array $icon ) Sets the icon property of the object.
5454
* @method Activity set_image( array $image ) Sets the image property of the object.
55+
* @method Activity set_content( string $content ) Sets the content property of the object.
5556
*/
5657
class Activity extends Base_Object {
5758
const JSON_LD_CONTEXT = array(

includes/transformer/class-base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected function transform_object_properties( $activity_object ) {
9090
if ( \method_exists( $this, $getter ) ) {
9191
$value = \call_user_func( array( $this, $getter ) );
9292

93-
if ( isset( $value ) ) {
93+
if ( ! empty( $value ) ) {
9494
$setter = 'set_' . $var;
9595

9696
/**

tests/includes/collection/class-test-outbox.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ public function test_delete_invalidates_all_activities() {
194194
/**
195195
* Helper method to create a dummy activity object for testing.
196196
*
197-
* @return \Activitypub\Activity\Base_Object
197+
* @return \Activitypub\Activity\Activity
198198
*/
199199
private function get_dummy_activity_object() {
200-
$object = new \Activitypub\Activity\Base_Object();
200+
$object = new \Activitypub\Activity\Activity();
201201
$object->set_id( 'https://example.com/test-object' );
202202
$object->set_type( 'Note' );
203203
$object->set_content( 'Test content' );
@@ -229,7 +229,7 @@ public function test_undo( $type, $expected ) {
229229

230230
// Only ID for Deletes.
231231
if ( 'Delete' === $expected ) {
232-
$this->assertSame( get_post( $undo_id )->post_title, $activity->get_object() );
232+
$this->assertSame( get_permalink( $id ), $activity->get_object() );
233233
} else {
234234
$this->assertEquals( json_decode( get_post( $undo_id )->post_content, true ), $activity->get_object()->to_array() );
235235
}

0 commit comments

Comments
 (0)