renderer_rtl_tests.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 ezcDocumentPdfRenderRtlTests extends ezcDocumentPdfTestCase
  35. {
  36. public static function suite()
  37. {
  38. return new PHPUnit_Framework_TestSuite( __CLASS__ );
  39. }
  40. public function testRenderAllRtl()
  41. {
  42. $this->renderFullDocument(
  43. dirname( __FILE__ ) . '/../files/pdf/long_text.xml',
  44. __CLASS__ . '_' . __FUNCTION__ . '.svg',
  45. array(
  46. new ezcDocumentPcssLayoutDirective(
  47. array( 'article' ),
  48. array(
  49. 'direction' => 'rtl',
  50. )
  51. ),
  52. )
  53. );
  54. }
  55. public function testRenderParagraphRtl()
  56. {
  57. $this->renderFullDocument(
  58. dirname( __FILE__ ) . '/../files/pdf/long_text.xml',
  59. __CLASS__ . '_' . __FUNCTION__ . '.svg',
  60. array(
  61. new ezcDocumentPcssLayoutDirective(
  62. array( 'para' ),
  63. array(
  64. 'direction' => 'rtl',
  65. )
  66. ),
  67. )
  68. );
  69. }
  70. public function testRenderTitleRtl()
  71. {
  72. $this->renderFullDocument(
  73. dirname( __FILE__ ) . '/../files/pdf/long_text.xml',
  74. __CLASS__ . '_' . __FUNCTION__ . '.svg',
  75. array(
  76. new ezcDocumentPcssLayoutDirective(
  77. array( 'title' ),
  78. array(
  79. 'direction' => 'rtl',
  80. )
  81. ),
  82. )
  83. );
  84. }
  85. }
  86. ?>