◆ testFetchFormats()
ilPageFormatsTest::testFetchFormats |
( |
| ) |
|
Definition at line 26 of file ilPageFormatsTest.php.
28 $languageMock = $this->getMockBuilder(ilLanguage::class)
29 ->disableOriginalConstructor()
30 ->onlyMethods([
'txt'])
33 $consecutive_returns = [
34 'certificate_a4' =>
'A4',
35 'certificate_a4_landscape' =>
'A4l',
36 'certificate_a5' =>
'A5',
37 'certificate_a5_landscape' =>
'A5l',
38 'certificate_letter' =>
'L',
39 'certificate_letter_landscape' =>
'Ll',
40 'certificate_custom' =>
'C',
42 $languageMock->method(
'txt')
43 ->willReturnCallback(fn($k) => $consecutive_returns[$k]);
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(
'A4', $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(
'A4l', $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(
'A5', $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(
'A5l', $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(
'L', $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(
'Ll', $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(
'C', $formats[
'custom'][
'name']);
The documentation for this class was generated from the following file: