diff options
author | Konrad Abicht <hi@inspirito.de> | 2021-02-09 15:48:37 +0100 |
---|---|---|
committer | Konrad Abicht <hi@inspirito.de> | 2021-02-09 15:48:37 +0100 |
commit | a50c615d374c344b1b12824eaf06a915ac158bcb (patch) | |
tree | ba17192f66afad0e367eab48bed1e1f587673e17 /tests/Core/Data | |
parent | a28705064b26e1714a4ec9b17366194afad2670d (diff) | |
download | nextcloud-server-a50c615d374c344b1b12824eaf06a915ac158bcb.tar.gz nextcloud-server-a50c615d374c344b1b12824eaf06a915ac158bcb.zip |
simplified tests
Signed-off-by: Konrad Abicht <hi@inspirito.de>
Diffstat (limited to 'tests/Core/Data')
-rw-r--r-- | tests/Core/Data/LoginFlowV2CredentialsTest.php | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/tests/Core/Data/LoginFlowV2CredentialsTest.php b/tests/Core/Data/LoginFlowV2CredentialsTest.php index e20a5fc9622..c56a11594aa 100644 --- a/tests/Core/Data/LoginFlowV2CredentialsTest.php +++ b/tests/Core/Data/LoginFlowV2CredentialsTest.php @@ -26,37 +26,36 @@ use OC\Core\Data\LoginFlowV2Credentials; use Test\TestCase; class LoginFlowV2CredentialsTest extends TestCase { - private function createInstance(string $server, string $loginName, string $appPassword) { - return new LoginFlowV2Credentials($server, $loginName, $appPassword); + /** @var \OC\Core\Data\LoginFlowV2Credentials */ + private $fixture; + + public function setUp(): void { + parent::setUp(); + + $this->fixture = new LoginFlowV2Credentials('server', 'login', 'pass'); } public function testImplementsJsonSerializable() { - $fixture = $this->createInstance('server', 'login', 'pass'); - - $this->assertTrue($fixture instanceof JsonSerializable); + $this->assertTrue($this->fixture instanceof JsonSerializable); } /** * Test getter functions. */ public function testGetter() { - $fixture = $this->createInstance('server', 'login', 'pass'); - - $this->assertEquals('server', $fixture->getServer()); - $this->assertEquals('login', $fixture->getLoginName()); - $this->assertEquals('pass', $fixture->getAppPassword()); + $this->assertEquals('server', $this->fixture->getServer()); + $this->assertEquals('login', $this->fixture->getLoginName()); + $this->assertEquals('pass', $this->fixture->getAppPassword()); } public function testJsonSerialize() { - $fixture = $this->createInstance('server', 'login', 'pass'); - $this->assertEquals( [ 'server' => 'server', 'loginName' => 'login', 'appPassword' => 'pass', ], - $fixture->jsonSerialize() + $this->fixture->jsonSerialize() ); } } |