document_pdf_footer_options_tests.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. /**
  3. * ezcDocTestConvertXhtmlDocbook
  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 dirname( __FILE__ ) . '/options_test_case.php';
  28. /**
  29. * Test suite for class.
  30. *
  31. * @package Document
  32. * @subpackage Tests
  33. */
  34. class ezcDocumentPdfFooterOptionsTests extends ezcDocumentOptionsTestCase
  35. {
  36. public static function suite()
  37. {
  38. return new PHPUnit_Framework_TestSuite( __CLASS__ );
  39. }
  40. protected function getOptionsClassName()
  41. {
  42. return 'ezcDocumentPdfFooterOptions';
  43. }
  44. public static function provideDefaultValues()
  45. {
  46. return array(
  47. array(
  48. 'height', ezcDocumentPcssMeasure::create( '15mm' ),
  49. ),
  50. array(
  51. 'footer', true,
  52. ),
  53. array(
  54. 'showDocumentTitle', true,
  55. ),
  56. array(
  57. 'showDocumentAuthor', true,
  58. ),
  59. array(
  60. 'showPageNumber', true,
  61. ),
  62. array(
  63. 'pageNumberOffset', 0,
  64. ),
  65. array(
  66. 'centerPageNumber', false,
  67. ),
  68. );
  69. }
  70. public static function provideValidData()
  71. {
  72. return array(
  73. array(
  74. 'footer',
  75. array( true, false ),
  76. ),
  77. array(
  78. 'showDocumentTitle',
  79. array( true, false ),
  80. ),
  81. array(
  82. 'showDocumentAuthor',
  83. array( true, false ),
  84. ),
  85. array(
  86. 'showPageNumber',
  87. array( true, false ),
  88. ),
  89. array(
  90. 'centerPageNumber',
  91. array( true, false ),
  92. ),
  93. array(
  94. 'pageNumberOffset',
  95. array( 0, 1, 23 ),
  96. ),
  97. );
  98. }
  99. public static function provideInvalidData()
  100. {
  101. return array(
  102. array(
  103. 'height',
  104. array( '15nm', 'foo', new StdClass() ),
  105. ),
  106. array(
  107. 'footer',
  108. array( 1, 23, 'foo', new StdClass() ),
  109. ),
  110. array(
  111. 'showDocumentTitle',
  112. array( 1, 23, 'foo', new StdClass() ),
  113. ),
  114. array(
  115. 'showDocumentAuthor',
  116. array( 1, 23, 'foo', new StdClass() ),
  117. ),
  118. array(
  119. 'showPageNumber',
  120. array( 1, 23, 'foo', new StdClass() ),
  121. ),
  122. array(
  123. 'centerPageNumber',
  124. array( 1, 23, 'foo', new StdClass() ),
  125. ),
  126. array(
  127. 'pageNumberOffset',
  128. array( true, 'foo', new StdClass() ),
  129. ),
  130. );
  131. }
  132. }
  133. ?>