public function storeDomainDistinguishedName($domain, DistinguishedName $distinguishedName) { try { $this->save('private/' . $domain . '/distinguished_name.json', $this->serializer->serialize($distinguishedName, JsonEncoder::FORMAT)); } catch (\Exception $e) { throw new AcmeCliException(sprintf('Storing of domain %s distinguished name failed', $domain), $e); } }
public function testLoadDomainDistinguishedName() { $dn = new DistinguishedName('example.org', 'France', 'Ile de France', 'Paris', 'Acme', 'PHP', '*****@*****.**', ['sub.example.org', 'sub.example.com']); $this->assertFalse($this->repository->hasDomainDistinguishedName('example.com')); $this->repository->storeDomainDistinguishedName('example.com', $dn); $this->assertTrue($this->repository->hasDomainDistinguishedName('example.com')); $this->assertEquals($dn, $this->repository->loadDomainDistinguishedName('example.com')); }