19 declare(strict_types=1);
28 $languageMock = $this->getMockBuilder(ilLanguage::class)
29 ->disableOriginalConstructor()
30 ->onlyMethods([
'txt'])
33 $languageMock->method(
'txt')
36 [
'certificate_a4_landscape'],
38 [
'certificate_a5_landscape'],
39 [
'certificate_letter'],
40 [
'certificate_letter_landscape'],
41 [
'certificate_custom']
43 ->willReturn(
'Some Translation');
47 $formats = $pageFormats->fetchPageFormats();
49 $this->assertSame(
'a4',
$formats[
'a4'][
'value']);
50 $this->assertSame(
'210mm',
$formats[
'a4'][
'width']);
52 $this->assertSame(
'297mm',
$formats[
'a4'][
'height']);
53 $this->assertSame(
'Some Translation',
$formats[
'a4'][
'name']);
55 $this->assertSame(
'a4landscape',
$formats[
'a4landscape'][
'value']);
56 $this->assertSame(
'297mm',
$formats[
'a4landscape'][
'width']);
57 $this->assertSame(
'210mm',
$formats[
'a4landscape'][
'height']);
58 $this->assertSame(
'Some Translation',
$formats[
'a4landscape'][
'name']);
60 $this->assertSame(
'a5',
$formats[
'a5'][
'value']);
61 $this->assertSame(
'148mm',
$formats[
'a5'][
'width']);
62 $this->assertSame(
'210mm',
$formats[
'a5'][
'height']);
63 $this->assertSame(
'Some Translation',
$formats[
'a5'][
'name']);
65 $this->assertSame(
'a5landscape',
$formats[
'a5landscape'][
'value']);
66 $this->assertSame(
'210mm',
$formats[
'a5landscape'][
'width']);
67 $this->assertSame(
'148mm',
$formats[
'a5landscape'][
'height']);
68 $this->assertSame(
'Some Translation',
$formats[
'a5landscape'][
'name']);
70 $this->assertSame(
'letter',
$formats[
'letter'][
'value']);
71 $this->assertSame(
'8.5in',
$formats[
'letter'][
'width']);
72 $this->assertSame(
'11in',
$formats[
'letter'][
'height']);
73 $this->assertSame(
'Some Translation',
$formats[
'letter'][
'name']);
75 $this->assertSame(
'letterlandscape',
$formats[
'letterlandscape'][
'value']);
76 $this->assertSame(
'11in',
$formats[
'letterlandscape'][
'width']);
77 $this->assertSame(
'8.5in',
$formats[
'letterlandscape'][
'height']);
78 $this->assertSame(
'Some Translation',
$formats[
'letterlandscape'][
'name']);
80 $this->assertSame(
'custom',
$formats[
'custom'][
'value']);
81 $this->assertSame(
'',
$formats[
'custom'][
'width']);
82 $this->assertSame(
'',
$formats[
'custom'][
'height']);
83 $this->assertSame(
'Some Translation',
$formats[
'custom'][
'name']);
Class ilCertificateBaseTestCase.