Blame view

export/PHPRtfLite-1.3.1/tests/PHPRtfLite/DocHead/FontTableTest.php 1.25 KB
f90e19c3   Andrea Petta   plugin update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  <?php
  
  /**
   * Test class for PHPRtfLite_DocHead_FontTable
   */
  class PHPRtfLite_DocHead_FontTableTest extends PHPUnit_Framework_TestCase
  {
  
      /**
       * tests getFontIndex
       * @testdox font index is false for a none added font
       */
      public function testGetFontIndexFalse()
      {
          $fontTable = new PHPRtfLite_DocHead_FontTable();
          $this->assertFalse($fontTable->getFontIndex('Verdana'));
      }
  
      /**
       * @dataProvider provideGetFontIndex
       * @param   PHPRtfLite_DocHead_FontTable    $fontTable
       * @param   string                          $font
       * @param   integer                         $fontIndex
       */
      public function testGetFontIndex(PHPRtfLite_DocHead_FontTable $fontTable, $font, $fontIndex)
      {
          $fontTable->add($font);
          $this->assertEquals($fontIndex, $fontTable->getFontIndex($font));
      }
  
      /**
       * provides test data for getFontIndex
       * @return array
       */
      public function provideGetFontIndex()
      {
          $fontTable = new PHPRtfLite_DocHead_FontTable();
          return array(
              array($fontTable, 'Verdana', 1),
              array($fontTable, 'Arial', 2),
              array($fontTable, 'Courier News', 3),
              array($fontTable, 'Times New Roman', 0),
          );
      }
  
  }