Initial commit
This commit is contained in:
26
tests/DigestMD5Test.php
Normal file
26
tests/DigestMD5Test.php
Normal 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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user