mirror of
https://github.com/buddypress/buddypress.git
synced 2026-07-21 20:54:17 +08:00
The email posts were being emptied out before the tests run because of the way the unit tests truncate the database tables. See #6592 git-svn-id: https://buddypress.svn.wordpress.org/trunk@10539 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
35 lines
849 B
PHP
35 lines
849 B
PHP
<?php
|
|
require_once dirname( __FILE__ ) . '/testcase.php';
|
|
|
|
class BP_UnitTestCase_Emails extends BP_UnitTestCase {
|
|
|
|
public static function setUpBeforeClass() {
|
|
parent::setUpBeforeClass();
|
|
|
|
require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );
|
|
|
|
/*
|
|
* WP's test suite wipes out BP's email posts.
|
|
* We must reestablish them before our tests can be successfully run.
|
|
*/
|
|
bp_core_install_emails();
|
|
}
|
|
|
|
public static function tearDownAfterClass() {
|
|
$emails = get_posts( array(
|
|
'fields' => 'ids',
|
|
'post_status' => 'any',
|
|
'post_type' => bp_get_email_post_type(),
|
|
'posts_per_page' => 200,
|
|
'suppress_filters' => false,
|
|
) );
|
|
|
|
if ( $emails ) {
|
|
foreach ( $emails as $email_id ) {
|
|
wp_delete_post( $email_id, true );
|
|
}
|
|
}
|
|
|
|
parent::tearDownAfterClass();
|
|
}
|
|
}
|