Skip to content

Commit 0941e60

Browse files
committed
Add test for db_server->get-supported-types operation.
1 parent 1f93d51 commit 0941e60

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

src/PleskX/Api/Operator/DatabaseServer.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,13 @@ class DatabaseServer extends \PleskX\Api\Operator
88

99
protected $_wrapperTag = 'db_server';
1010

11+
/**
12+
* @return array
13+
*/
14+
public function getSupportedTypes()
15+
{
16+
$response = $this->request('get-supported-types');
17+
return (array)$response->type;
18+
}
19+
1120
}

tests/DatabaseServerTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
// Copyright 1999-2014. Parallels IP Holdings GmbH. All Rights Reserved.
3+
4+
class DatabaseServerTest extends TestCase
5+
{
6+
7+
public function testGetSupportedTypes()
8+
{
9+
$types = $this->_client->databaseServer()->getSupportedTypes();
10+
$this->assertGreaterThan(0, count($types));
11+
$this->assertContains('mysql', $types);
12+
}
13+
14+
}

tests/phpunit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<file>ApiClientTest.php</file>
66
<file>CertificateTest.php</file>
77
<file>CustomerTest.php</file>
8+
<file>DatabaseServerTest.php</file>
89
<file>EventLog.php</file>
910
<file>IpTest.php</file>
1011
<file>LocaleTest.php</file>

0 commit comments

Comments
 (0)