renderer_mediaobject_tests.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * ezcDocumentPdfDriverTcpdfTests
  4. *
  5. * Licensed to the Apache Software Foundation (ASF) under one
  6. * or more contributor license agreements. See the NOTICE file
  7. * distributed with this work for additional information
  8. * regarding copyright ownership. The ASF licenses this file
  9. * to you under the Apache License, Version 2.0 (the
  10. * "License"); you may not use this file except in compliance
  11. * with the License. You may obtain a copy of the License at
  12. *
  13. * http://www.apache.org/licenses/LICENSE-2.0
  14. *
  15. * Unless required by applicable law or agreed to in writing,
  16. * software distributed under the License is distributed on an
  17. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18. * KIND, either express or implied. See the License for the
  19. * specific language governing permissions and limitations
  20. * under the License.
  21. *
  22. * @package Document
  23. * @version //autogen//
  24. * @subpackage Tests
  25. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  26. */
  27. require_once 'base.php';
  28. /**
  29. * Test suite for class.
  30. *
  31. * @package Document
  32. * @subpackage Tests
  33. */
  34. class ezcDocumentPdfMediaObjectRendererTests extends ezcDocumentPdfTestCase
  35. {
  36. protected $document;
  37. protected $xpath;
  38. protected $styles;
  39. public static function suite()
  40. {
  41. return new PHPUnit_Framework_TestSuite( __CLASS__ );
  42. }
  43. public function testRenderMainSinglePage()
  44. {
  45. $this->renderFullDocument(
  46. dirname( __FILE__ ) . '/../files/pdf/image.xml',
  47. __CLASS__ . '_' . __FUNCTION__ . '.svg'
  48. );
  49. }
  50. public function testRenderInMultipleColumns()
  51. {
  52. $this->renderFullDocument(
  53. dirname( __FILE__ ) . '/../files/pdf/image.xml',
  54. __CLASS__ . '_' . __FUNCTION__ . '.svg',
  55. array(
  56. new ezcDocumentPcssLayoutDirective(
  57. array( 'article' ),
  58. array(
  59. 'text-columns' => '2',
  60. 'font-size' => '10pt',
  61. )
  62. ),
  63. new ezcDocumentPcssLayoutDirective(
  64. array( 'title' ),
  65. array(
  66. 'text-columns' => '2',
  67. )
  68. ),
  69. new ezcDocumentPcssLayoutDirective(
  70. array( 'page' ),
  71. array(
  72. 'page-size' => 'A5',
  73. )
  74. ),
  75. )
  76. );
  77. }
  78. public function testRenderLargeImage()
  79. {
  80. $this->renderFullDocument(
  81. dirname( __FILE__ ) . '/../files/pdf/image_large.xml',
  82. __CLASS__ . '_' . __FUNCTION__ . '.svg',
  83. array(
  84. )
  85. );
  86. }
  87. public function testRenderHighImage()
  88. {
  89. $this->renderFullDocument(
  90. dirname( __FILE__ ) . '/../files/pdf/image_high.xml',
  91. __CLASS__ . '_' . __FUNCTION__ . '.svg',
  92. array(
  93. )
  94. );
  95. }
  96. public function testRenderWrappedLargeImageAndWrappedText()
  97. {
  98. $this->renderFullDocument(
  99. dirname( __FILE__ ) . '/../files/pdf/image_wrapped.xml',
  100. __CLASS__ . '_' . __FUNCTION__ . '.svg',
  101. array(
  102. )
  103. );
  104. }
  105. }
  106. ?>