public static function wpSetUpBeforeClass($factory) { self::$editor_user_id = $factory->user->create(array('role' => 'editor')); self::$author_user_id = $factory->user->create(array('role' => 'author')); self::$editor_private_post = $factory->post->create(array('post_author' => self::$editor_user_id, 'post_status' => 'private')); self::$author_private_post = $factory->post->create(array('post_author' => self::$author_user_id, 'post_status' => 'private')); // Custom status with private=true. register_post_status('privatefoo', array('private' => true)); self::$editor_privatefoo_post = $factory->post->create(array('post_author' => self::$editor_user_id, 'post_status' => 'privatefoo')); self::$author_privatefoo_post = $factory->post->create(array('post_author' => self::$author_user_id, 'post_status' => 'privatefoo')); _unregister_post_status('privatefoo'); }
public static function setUpBeforeClass() { $f = new WP_UnitTest_Factory(); self::$editor_user = $f->user->create(array('role' => 'editor')); self::$author_user = $f->user->create(array('role' => 'author')); self::$editor_private_post = $f->post->create(array('post_author' => self::$editor_user, 'post_status' => 'private')); self::$author_private_post = $f->post->create(array('post_author' => self::$author_user, 'post_status' => 'private')); // Custom status with private=true. register_post_status('privatefoo', array('private' => true)); self::$editor_privatefoo_post = $f->post->create(array('post_author' => self::$editor_user, 'post_status' => 'privatefoo')); self::$author_privatefoo_post = $f->post->create(array('post_author' => self::$author_user, 'post_status' => 'privatefoo')); _unregister_post_status('privatefoo'); self::commit_transaction(); }