27 lines
717 B
PHP
27 lines
717 B
PHP
|
<?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());
|
||
|
}
|
||
|
}
|