Refactored Peer Information to use InformationFields rather than being hard-coded into the peer record

This commit is contained in:
netkas 2025-01-24 15:10:20 -05:00
parent 75de51c910
commit f689e36378
45 changed files with 1422 additions and 1337 deletions

View file

@ -5,6 +5,7 @@
use PHPUnit\Framework\TestCase;
use Socialbox\Classes\ServerResolver;
use Socialbox\Enums\Flags\SessionFlags;
use Socialbox\Enums\Types\InformationFieldName;
class SocialClientTest extends TestCase
{
@ -45,7 +46,7 @@
{
$client = new SocialClient(self::generateUsername($domain));
$client->settingsSetPassword("password");
$client->settingsSetDisplayName("Example User");
$client->settingsAddInformationField(InformationFieldName::DISPLAY_NAME, "Example User");
return $client;
}
@ -62,7 +63,7 @@
// Check progressive session state
$this->assertTrue($coffeeClient->settingsSetPassword('coffeePassword'));
$this->assertFalse($coffeeClient->getSessionState()->containsFlag(SessionFlags::SET_PASSWORD));
$this->assertTrue($coffeeClient->settingsSetDisplayName('Coffee User'));
$this->assertTrue($coffeeClient->settingsAddInformationField(InformationFieldName::DISPLAY_NAME, 'Coffee User'));
$this->assertFalse($coffeeClient->getSessionState()->containsFlag(SessionFlags::SET_DISPLAY_NAME));
$this->assertFalse($coffeeClient->getSessionState()->containsFlag(SessionFlags::REGISTRATION_REQUIRED));