diff options
Diffstat (limited to 'tests/phpunit/integration/includes')
-rw-r--r-- | tests/phpunit/integration/includes/user/ActorStoreTest.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/phpunit/integration/includes/user/ActorStoreTest.php b/tests/phpunit/integration/includes/user/ActorStoreTest.php index 79bd4d040f38..c0524353b366 100644 --- a/tests/phpunit/integration/includes/user/ActorStoreTest.php +++ b/tests/phpunit/integration/includes/user/ActorStoreTest.php @@ -750,6 +750,23 @@ class ActorStoreTest extends ActorStoreTestBase { $this->assertSameActors( $anotherActor, $store->getActorById( $anotherActorId, $this->db ) ); } + public function testUserRenameUpdatesActor() { + $user = $this->getMutableTestUser()->getUser(); + $oldName = $user->getName(); + + $store = $this->getStore(); + $actorId = $store->findActorId( $user, $this->db ); + $this->assertTrue( $actorId > 0 ); + + $user->setName( 'NewName' ); + $user->saveSettings(); + + $this->assertSameActors( $user, $store->getActorById( $actorId, $this->db ) ); + $this->assertSameActors( $user, $store->getUserIdentityByName( 'NewName' ) ); + $this->assertSameActors( $user, $store->getUserIdentityByUserId( $user->getId() ) ); + $this->assertNull( $store->getUserIdentityByName( $oldName ) ); + } + /** * @covers ::acquireSystemActorId */ |