forked from plesk/api-php-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhpHandlerTest.php
35 lines (26 loc) · 907 Bytes
/
PhpHandlerTest.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
<?php
// Copyright 1999-2022. Plesk International GmbH.
namespace PleskXTest;
class PhpHandlerTest extends AbstractTestCase
{
public function testGet()
{
$handler = static::$client->phpHandler()->get();
$this->assertObjectHasAttribute('type', $handler);
}
public function testGetAll()
{
$handlers = static::$client->phpHandler()->getAll();
$this->assertIsArray($handlers);
$this->assertNotEmpty($handlers);
$handler = current($handlers);
$this->assertIsObject($handler);
$this->assertObjectHasAttribute('type', $handler);
}
public function testGetUnknownHandlerThrowsException()
{
$this->expectException(\PleskX\Api\Exception::class);
$this->expectExceptionMessage('Php handler does not exists');
static::$client->phpHandler()->get('id', 'this-handler-does-not-exist');
}
}