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