You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
953 B
PHP

<?php
// Copyright 1999-2021. Plesk International GmbH.
namespace PleskXTest;
class PhpHandlerTest extends TestCase
{
public function testGet()
{
$handler = static::$_client->phpHandler()->get(null, null);
$this->assertIsObject($handler);
$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');
}
}