-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathDatabaseServerTest.php
36 lines (31 loc) · 1.07 KB
/
DatabaseServerTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
// Copyright 1999-2025. WebPros International GmbH.
namespace PleskXTest;
class DatabaseServerTest extends AbstractTestCase
{
public function testGetSupportedTypes()
{
$types = static::$client->databaseServer()->getSupportedTypes();
$this->assertGreaterThan(0, count($types));
$this->assertContains('mysql', $types);
}
public function testGet()
{
$dbServer = static::$client->databaseServer()->get('id', 1);
$this->assertEquals('localhost', $dbServer->host);
$this->assertGreaterThan(0, $dbServer->port);
}
public function testGetAll()
{
$dbServers = static::$client->databaseServer()->getAll();
$this->assertIsArray($dbServers);
$this->assertGreaterThan(0, count($dbServers));
$this->assertEquals('localhost', $dbServers[0]->host);
}
public function testGetDefault()
{
$dbServer = static::$client->databaseServer()->getDefault('mysql');
$this->assertEquals('mysql', $dbServer->type);
$this->assertGreaterThan(0, $dbServer->id);
}
}