Initial commit

This commit is contained in:
2024-09-13 14:11:34 +02:00
commit a14f7077bb
31 changed files with 1901 additions and 0 deletions

26
tests/DigestMD5Test.php Normal file
View File

@ -0,0 +1,26 @@
<?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());
}
}