-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Simplify Actor-Settings The new version uses a radio button instead of checkboxes. This way it is better to explain the different modes. * revert unnecessary changes * remove old settings to not replace them by accident * Update templates/settings.php Co-authored-by: Konstantin Obenland <[email protected]> * Update templates/settings.php Co-authored-by: Alex Kirk <[email protected]> * Update templates/settings.php Co-authored-by: Alex Kirk <[email protected]> * Update templates/settings.php Co-authored-by: Alex Kirk <[email protected]> * Update includes/class-admin.php Co-authored-by: Konstantin Obenland <[email protected]> * use constants * Update templates/settings.php Co-authored-by: Alex Kirk <[email protected]> * Update templates/settings.php Co-authored-by: Alex Kirk <[email protected]> * add comment * add output escaping * fix escaping * Update templates/settings.php Co-authored-by: Matt Wiebe <[email protected]> * Update templates/settings.php Co-authored-by: Matt Wiebe <[email protected]> * Update templates/settings.php Co-authored-by: Matt Wiebe <[email protected]> * call migration! * add unit tests * use descriptive consts --------- Co-authored-by: Konstantin Obenland <[email protected]> Co-authored-by: Alex Kirk <[email protected]> Co-authored-by: Matt Wiebe <[email protected]>
- Loading branch information
1 parent
280e640
commit 418b8dc
Showing
6 changed files
with
128 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
class Test_Activitypub_Migrate extends ActivityPub_TestCase_Cache_HTTP { | ||
|
||
public function test_migrate_actor_mode() { | ||
\delete_option( 'activitypub_actor_mode' ); | ||
|
||
\Activitypub\Migration::migrate_actor_mode(); | ||
|
||
$this->assertEquals( ACTIVITYPUB_ACTOR_MODE, \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE ) ); | ||
|
||
\update_option( 'activitypub_enable_blog_user', '0' ); | ||
\update_option( 'activitypub_enable_users', '1' ); | ||
\delete_option( 'activitypub_actor_mode' ); | ||
|
||
\Activitypub\Migration::migrate_actor_mode(); | ||
|
||
$this->assertEquals( ACTIVITYPUB_ACTOR_MODE, \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE ) ); | ||
|
||
\update_option( 'activitypub_enable_blog_user', '1' ); | ||
\update_option( 'activitypub_enable_users', '1' ); | ||
\delete_option( 'activitypub_actor_mode' ); | ||
|
||
\Activitypub\Migration::migrate_actor_mode(); | ||
|
||
$this->assertEquals( ACTIVITYPUB_ACTOR_AND_BLOG_MODE, \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE ) ); | ||
|
||
\update_option( 'activitypub_enable_blog_user', '1' ); | ||
\update_option( 'activitypub_enable_users', '0' ); | ||
\delete_option( 'activitypub_actor_mode' ); | ||
|
||
\Activitypub\Migration::migrate_actor_mode(); | ||
|
||
$this->assertEquals( ACTIVITYPUB_BLOG_MODE, \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE ) ); | ||
|
||
\delete_option( 'activitypub_enable_blog_user' ); | ||
\update_option( 'activitypub_enable_users', '0' ); | ||
\delete_option( 'activitypub_actor_mode' ); | ||
|
||
\Activitypub\Migration::migrate_actor_mode(); | ||
|
||
$this->assertEquals( ACTIVITYPUB_ACTOR_MODE, \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE ) ); | ||
|
||
\update_option( 'activitypub_enable_blog_user', '0' ); | ||
\delete_option( 'activitypub_enable_users' ); | ||
\delete_option( 'activitypub_actor_mode' ); | ||
|
||
\Activitypub\Migration::migrate_actor_mode(); | ||
|
||
$this->assertEquals( ACTIVITYPUB_ACTOR_MODE, \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE ) ); | ||
} | ||
} |