Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/07/2013 05:15:51 PM (12 years ago)
Author:
johnjamesjacoby
Message:

First pass at bp-notifications component. Includes:

  • Backwards compatibility for old core functions.
  • Screens, functions, classes, and actions for Notifications.
  • Improved class methods for getting, updating, and deleting notifications.
  • Template parts in bp-legacy for theme compatibility.
  • A few basic unit tests.

@todo's:

  • Improve template output with dedicated functions, markup, classes, et all.
  • More unit tests.
  • Pagination links.
  • Auto-activate on update, so existing installations do not lose previously core functionality.

See #5148. Props johnjamesjacoby, boonebgorges, r-a-y.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/includes/factory.php

    r7107 r7521  
    1010        $this->xprofile_group = new BP_UnitTest_Factory_For_XProfileGroup( $this );
    1111        $this->xprofile_field = new BP_UnitTest_Factory_For_XProfileField( $this );
     12        $this->notification = new BP_UnitTest_Factory_For_Notification( $this );
    1213    }
    1314}
     
    147148    }
    148149}
     150
     151class BP_UnitTest_Factory_For_Notification extends WP_UnitTest_Factory_For_Thing {
     152    public function __construct( $factory = null ) {
     153        parent::__construct( $factory );
     154    }
     155
     156    public function create_object( $args ) {
     157        return bp_notifications_add_notification( $args );
     158    }
     159
     160    public function update_object( $id, $fields ) {}
     161
     162    public function get_object_by_id( $id ) {
     163        return new BP_Notifications_Notification( $id );
     164    }
     165}
Note: See TracChangeset for help on using the changeset viewer.