authName)->request('GET', '/api/users/authName/' . $requestUser->authName); $this->assertResponseStatusCodeSame(200); $this->assertEquals($requestUser->getId(), $response->toArray()['id']); } /** * Requirement: A user should be able to update his properties */ public function testUpdateUserProperties(): void { $requestUser = UserFactory::createOne(); $response = static::createClientWithToken($requestUser->authName)->request('PATCH', $this->getIri($requestUser), [ 'headers' => [ 'content-type' => 'application/merge-patch+json' ], 'json' => [ 'properties' => [ 'a' => 1, 'b' => true, 'c' => null, 'd' => 'text' ] ] ]); $this->assertResponseStatusCodeSame(200); $this->assertEquals(1, $response->toArray()['properties']['a']); $this->assertEquals(true, $response->toArray()['properties']['b']); $this->assertEquals(null, $response->toArray()['properties']['c']); $this->assertEquals('text', $response->toArray()['properties']['d']); } /** * Requirement: A user should NOT be able to update his authName */ public function testUpdateUserAuthnameNotPossible(): void { $requestUser = UserFactory::createOne(); $response = static::createClientWithToken($requestUser->authName)->request('PATCH', $this->getIri($requestUser), [ 'headers' => [ 'content-type' => 'application/merge-patch+json' ], 'json' => [ 'authName' => 'foo.bar' ] ]); $this->assertResponseStatusCodeSame(200); $this->assertNotEquals("foo.bar", $response->toArray()['authName']); } }