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

31
tests/AuthPlainTest.php Normal file
View File

@ -0,0 +1,31 @@
<?php
use Pdahal\Xmpp\AuthTypes\Plain;
use Pdahal\Xmpp\Options;
use PHPUnit\Framework\TestCase;
/**
* @internal
*
* @coversNothing
*/
class AuthPlainTest extends TestCase
{
public Plain $plainAuth;
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->plainAuth = new Plain($this->optionsStub);
}
public function testIfCredentialsAreEncodedRight(): void
{
$this->assertEquals('AEZvbwBCYXI=', $this->plainAuth->encodedCredentials());
}
}