mirror of
https://github.com/Automattic/wordpress-activitypub
synced 2024-10-18 11:43:31 +00:00
79f400d88a
* Use an ActivityPub capability to better enable/disable ActivityPub support * split PRs * remove test hook * do not run migrations for new installs * fix unit tests * fix unit tests * remove abandoned schedule! * fix migration class * fix order * restructuring * remove follower migration * do not yet remove legacy followers * remove blog-user changes * use a const for the version number * add user tests and fix old ones * use a more generic async migrator * optimized test
33 lines
798 B
PHP
33 lines
798 B
PHP
<?php
|
|
class Test_Activitypub_User extends WP_UnitTestCase {
|
|
|
|
public function test_activitypub_cap() {
|
|
$userdata = array(
|
|
'user_email' => 'subscriber@example.com',
|
|
'first_name' => 'Max',
|
|
'last_name' => 'Mustermann',
|
|
'user_login' => 'subscriber',
|
|
'user_pass' => 'subscriber',
|
|
'role' => 'subscriber',
|
|
);
|
|
|
|
$user_id = wp_insert_user( $userdata );
|
|
$can = user_can( $user_id, 'activitypub' );
|
|
|
|
$this->assertFalse( $can );
|
|
|
|
$userdata = array(
|
|
'user_email' => 'editor@example.com',
|
|
'first_name' => 'Max',
|
|
'last_name' => 'Mustermann',
|
|
'user_login' => 'editor',
|
|
'user_pass' => 'editor',
|
|
'role' => 'editor',
|
|
);
|
|
|
|
$user_id = wp_insert_user( $userdata );
|
|
$can = user_can( $user_id, 'activitypub' );
|
|
|
|
$this->assertTrue( $can );
|
|
}
|
|
}
|