driver_svg_tests.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * ezcDocumentPdfDriverHaruTests
  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 'driver_tests.php';
  28. /**
  29. * Test suite for class.
  30. *
  31. * @package Document
  32. * @subpackage Tests
  33. */
  34. class ezcDocumentPdfDriverSvgTests extends ezcDocumentPdfDriverTests
  35. {
  36. /**
  37. * Extension of generated files
  38. *
  39. * @var string
  40. */
  41. protected $extension = 'svg';
  42. /**
  43. * Expected font widths for calculateWordWidth tests
  44. *
  45. * @var array
  46. */
  47. protected $expectedWidths = array(
  48. 'testEstimateDefaultWordWidthWithoutPageCreation' => 21.6,
  49. 'testEstimateDefaultWordWidth' => 21.6,
  50. 'testEstimateWordWidthDifferentSize' => 30.1,
  51. 'testEstimateWordWidthDifferentSizeAndUnit' => 10.6,
  52. 'testEstimateBoldWordWidth' => 21.6,
  53. 'testEstimateMonospaceWordWidth' => 25.8,
  54. 'testFontStyleFallback' => 21.6,
  55. 'testUtf8FontWidth' => 21.6,
  56. 'testCustomFontWidthEstimation' => 51.6,
  57. );
  58. public static function suite()
  59. {
  60. return new PHPUnit_Framework_TestSuite( __CLASS__ );
  61. }
  62. /**
  63. * Get driver to test
  64. *
  65. * @return ezcDocumentPdfDriver
  66. */
  67. protected function getDriver()
  68. {
  69. return new ezcDocumentPdfSvgDriver();
  70. }
  71. }
  72. ?>