Changeset 5673 for trunk/tests/phpunit/includes/factory.php
- Timestamp:
- 04/07/2015 12:35:06 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/includes/factory.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/factory.php
r5610 r5673 2 2 3 3 class BBP_UnitTest_Factory extends WP_UnitTest_Factory { 4 function __construct() { 4 5 public $forum = null; 6 7 public function __construct() { 5 8 parent::__construct(); 9 10 $this->forum = new BBP_UnitTest_Factory_For_Forum( $this ); 6 11 } 7 12 } 13 14 class BBP_UnitTest_Factory_For_Forum extends WP_UnitTest_Factory_For_Thing { 15 16 public function __construct( $factory = null ) { 17 parent::__construct( $factory ); 18 19 $this->default_generation_definitions = array( 20 'post_title' => new WP_UnitTest_Generator_Sequence( 'Forum %s' ), 21 'post_content' => new WP_UnitTest_Generator_Sequence( 'Content of Forum %s' ), 22 ); 23 } 24 25 public function create_object( $args ) { 26 return bbp_insert_forum( $args ); 27 } 28 29 public function update_object( $forum_id, $fields ) { 30 $fields['forum_id'] = $forum_id; 31 return bbp_update_forum( $fields ); 32 } 33 34 public function get_object_by_id( $forum_id ) { 35 return bbp_get_forum( $forum_id ); 36 } 37 }
Note: See TracChangeset
for help on using the changeset viewer.