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.

25 lines
825 B
PHP

<?php
// Copyright 1999-2021. Plesk International GmbH.
namespace PleskXTest;
class CertificateTest extends TestCase
{
public function testGenerate()
{
$certificate = static::$_client->certificate()->generate([
'bits' => 2048,
'country' => 'RU',
'state' => 'NSO',
'location' => 'Novosibirsk',
'company' => 'Plesk',
'email' => 'info@plesk.com',
'name' => 'plesk.com',
]);
$this->assertGreaterThan(0, strlen($certificate->request));
$this->assertStringStartsWith('-----BEGIN CERTIFICATE REQUEST-----', $certificate->request);
$this->assertGreaterThan(0, strlen($certificate->privateKey));
$this->assertStringStartsWith('-----BEGIN PRIVATE KEY-----', $certificate->privateKey);
}
}