trim credentials
This commit is contained in:
bovenliggende
5724a50ba2
commit
e203b5126f
@ -57,8 +57,8 @@ class Connection
|
|||||||
->notBlank()
|
->notBlank()
|
||||||
->verifyNow();
|
->verifyNow();
|
||||||
|
|
||||||
$this->client_key = $client_key;
|
$this->client_key = trim($client_key);
|
||||||
$this->secret_key = $secret_key;
|
$this->secret_key = trim($secret_key);
|
||||||
$this->cookies_jar = new CookieJar();
|
$this->cookies_jar = new CookieJar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,11 +56,11 @@ class ConnectionTest extends TestCase
|
|||||||
$sut = new Connection($userName, $password);
|
$sut = new Connection($userName, $password);
|
||||||
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
$userName,
|
trim($userName),
|
||||||
$sut->getClientKey()
|
$sut->getClientKey()
|
||||||
);
|
);
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
$password,
|
trim($password),
|
||||||
$sut->getSecretKey()
|
$sut->getSecretKey()
|
||||||
);
|
);
|
||||||
$this->assertInstanceOf(
|
$this->assertInstanceOf(
|
||||||
@ -71,7 +71,7 @@ class ConnectionTest extends TestCase
|
|||||||
|
|
||||||
public static function constructDataProvider(): Generator
|
public static function constructDataProvider(): Generator
|
||||||
{
|
{
|
||||||
yield 'all credentials set' => ['myuser', 'mypassword', false];
|
yield 'all credentials set' => [' myuser', ' mypassword', false];
|
||||||
yield 'missing username' => ['', 'mypassword', true];
|
yield 'missing username' => ['', 'mypassword', true];
|
||||||
yield 'missing password' => ['myuser', '', true];
|
yield 'missing password' => ['myuser', '', true];
|
||||||
yield 'no credentials given' => ['', '', true];
|
yield 'no credentials given' => ['', '', true];
|
||||||
|
Laden…
x
Verwijs in nieuw issue
Block a user