old_current_user = get_current_user_id();
$this->set_current_user( $this->factory->user->create( array( 'role' => 'subscriber' ) ) );
}
public function tearDown() {
parent::tearDown();
$this->set_current_user( $this->old_current_user );
}
/**
* @ticket BP4488
*/
public function test_thumbnail_content_images() {
// No images
$post_content = 'foo bar';
$this->assertEquals( bp_activity_thumbnail_content_images( $post_content ), 'foo bar' );
// Image first, no caption. See #BP4488
$post_content = '
foo bar';
$this->assertEquals( bp_activity_thumbnail_content_images( $post_content ), '
foo bar' );
// Image first, caption. See #BP4488
$post_content = '[caption id="attachment_236" align="alignnone" width="40"]
FOO![/caption] Awesome.';
$this->assertEquals( bp_activity_thumbnail_content_images( $post_content ), '
Awesome.' );
}
}