Index: tests/phpunit/includes/factory.php
===================================================================
--- tests/phpunit/includes/factory.php	(revision 11059)
+++ tests/phpunit/includes/factory.php	(working copy)
@@ -13,6 +13,7 @@
 		$this->xprofile_field = new BP_UnitTest_Factory_For_XProfileField( $this );
 		$this->notification = new BP_UnitTest_Factory_For_Notification( $this );
 		$this->signup = new BP_UnitTest_Factory_For_Signup( $this );
+		$this->friendship = new BP_UnitTest_Factory_For_Friendship( $this );
 	}
 }
 
@@ -268,3 +269,37 @@
 		return new BP_Signup( $id );
 	}
 }
+
+class BP_UnitTest_Factory_For_Friendship extends WP_UnitTest_Factory_For_Thing {
+	public function __construct( $factory = null ) {
+		parent::__construct( $factory );
+	}
+
+	public function create_object( $args ) {
+		$friendship = new BP_Friends_Friendship();
+		
+		foreach ( array( 'initiator_user_id', 'firend_user_id' ) as $arg ) {
+			if ( isset( $args[ $arg ] ) ) {
+				$friendship->$arg = $args[ $arg ];
+			} else {
+				$friendship->$arg = $this->factory->user->create();
+			}
+		}
+
+		foreach ( array( 'is_confirmed', 'is_limited', 'date_created' ) as $arg ) {
+			if ( isset( $args[ $arg ] ) ) {
+				$friendship->$arg = $args[ $arg ];
+			}
+		}
+		
+		$friendship->save();
+		
+		return $friendship->id;
+	}
+
+	public function update_object( $id, $fields ) {}
+
+	public function get_object_by_id( $id ) {
+		return new BP_Friends_Friendship( $id );
+	}
+}
