Files
php-xmpp/tests/DigestMD5Test.php

27 lines
717 B
PHP
Raw Normal View History

2024-09-13 14:11:34 +02:00
<?php
use Pdahal\Xmpp\AuthTypes\DigestMD5;
use Pdahal\Xmpp\Options;
use PHPUnit\Framework\TestCase;
class DigestMD5Test extends TestCase
{
public DigestMD5 $digestAuth;
public Options $optionsStub;
protected function setUp(): void
{
$this->optionsStub = $this->createMock(Options::class);
$this->optionsStub->method('getUsername')->willReturn('Foo');
$this->optionsStub->method('getPassword')->willReturn('Bar');
$this->digestAuth = new DigestMD5($this->optionsStub);
}
public function testIfCredentialsAreEncodedRight(): void
{
$this->assertEquals("80e25ae4140c338afbe621c1b3d7a9ec9480f731", $this->digestAuth->encodedCredentials());
}
}