/**
* @group certificate
*
* @test
*/
public function loading_a_certificate_from_file_creates_a_key()
{
$file = dirname(__FILE__) . '/File/example.org.crt';
$this->keyLoader->loadCertificateFile($file);
$loadedKeys = $this->keyLoader->getKeys();
$loadedKey = $loadedKeys->get(0);
$fileContents = file_get_contents($file);
preg_match(Certificate::CERTIFICATE_PATTERN, $fileContents, $matches);
$expected = preg_replace('~\\s+~', '', $matches[1]);
$this->assertTrue($this->keyLoader->hasKeys());
$this->assertCount(1, $loadedKeys);
$this->assertEquals($expected, $loadedKey['X509Certificate']);
}