Issues (752)

plugins/smime/test/testOCSPCertificate.php (2 issues)

1
<?php
2
3
require_once 'php/class.certificate.php';
4
require_once 'php/util.php';
5
6
/**
7
 * @internal
8
 *
9
 * @coversNothing
10
 */
11
class OCSPCertificateTest extends PHPUnit_Framework_TestCase {
0 ignored issues
show
The type PHPUnit_Framework_TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
	protected $cert;
13
14
	protected function setUp() {
15
		$this->certdata = file_get_contents('./test/user.crt');
0 ignored issues
show
Bug Best Practice introduced by
The property certdata does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
16
		$this->cert = new Certificate($this->certdata);
17
	}
18
19
	public function testEmailaddress() {
20
		$this->assertEquals($this->cert->emailAddress(), '[email protected]');
21
	}
22
23
	public function testDerPem() {
24
		$pem = $this->cert->pem();
25
		$der = $this->cert->der();
26
27
		// FIXME: remove der2pem
28
		$this->assertEquals($pem, der2pem($der));
29
		$this->assertEquals($this->certdata, $pem);
30
	}
31
32
	public function testValidFrom() {
33
		$this->assertEquals($this->cert->validFrom(), 1491298233);
34
	}
35
36
	public function testValidTo() {
37
		$this->assertEquals($this->cert->validTo(), 1523698233);
38
	}
39
40
	public function testExpired() {
41
		$this->assertEquals($this->cert->valid(), false);
42
	}
43
44
	public function testCAURL() {
45
		$this->assertNotEmpty($this->cert->caURL());
46
	}
47
48
	public function testOCSPURL() {
49
		$this->assertNotEmpty($this->cert->ocspURL());
50
	}
51
}
52