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