Gtk_ScrollingLabel
[ class tree: Gtk_ScrollingLabel ] [ index: Gtk_ScrollingLabel ] [ all elements ]

Source for file Gtk_ScrollingLabelTest.php

Documentation is available at Gtk_ScrollingLabelTest.php

  1. <?php
  2. /**
  3.  * PHPUnit test case for Gtk_ScrollingLabel
  4.  * 
  5.  * The method skeletons below need to be filled in with
  6.  * real data so that the tests will run correctly. Replace
  7.  * all EXPECTED_VAL and PARAM strings with real data.
  8.  * 
  9.  * Created with PHPUnit_Skeleton on 2004-09-30
  10.  */
  11. require_once 'PHPUnit.php';
  12. class Gtk_ScrollingLabelTest extends PHPUnit_TestCase {
  13.  
  14.     var $Gtk_ScrollingLabel;
  15.  
  16.     function Gtk_ScrollingLabelTest($name)
  17.     {
  18.         $this->PHPUnit_TestCase($name);
  19.     }
  20.  
  21.     function setUp()
  22.     {
  23.         require_once 'ScrollingLabel.php';
  24.         $this->Gtk_ScrollingLabel =new Gtk_ScrollingLabel();
  25.         $this->Gtk_ScrollingLabel->setfulltext('This is some test text');
  26.     }
  27.  
  28.     function tearDown()
  29.     {
  30.         unset($this->Gtk_ScrollingLabel);
  31.     }
  32.  
  33.     function testsetspeed()
  34.     {
  35.         $result   $this->Gtk_ScrollingLabel->setspeed(100);
  36.         $expected = 100;
  37.         $this->assertEquals($expected$result);
  38.     }
  39.  
  40.     function testsetdirection()
  41.     {
  42.         $result   $this->Gtk_ScrollingLabel->setdirection(GTK_SCROLLINGLABEL_LEFT);
  43.         $expected GTK_SCROLLINGLABEL_LEFT;
  44.         $this->assertEquals($expected$result);
  45.     }
  46.  
  47.     function testsetbounce()
  48.     {
  49.         $result   $this->Gtk_ScrollingLabel->setbounce(true);
  50.         $expected = true;
  51.         $this->assertEquals($expected$result);
  52.     }
  53.  
  54.     function testgetvisibletext()
  55.     {
  56.         $result   $this->Gtk_ScrollingLabel->getvisibletext();
  57.         $expected str_pad('This is some test text'70' 'STR_PAD_LEFT);
  58.         $this->assertEquals($expected$result);
  59.     }
  60.  
  61.     function testgetfulltext()
  62.     {
  63.         $result   $this->Gtk_ScrollingLabel->getfulltext();
  64.         $expected 'This is some test text';
  65.         $this->assertEquals($expected$result);
  66.     }
  67.  
  68.     function testgethiddentext()
  69.     {
  70.         $this->Gtk_ScrollingLabel->setVisibleLength(4);
  71.         $result   $this->Gtk_ScrollingLabel->gethiddentext();
  72.         $expected ' is some test text';
  73.         $this->assertEquals($expected$result);
  74.     }
  75.  
  76.     function testsetfulltext()
  77.     {
  78.         $this->Gtk_ScrollingLabel->setFullText('This is some test text');
  79.         $expected 'This is some test text';
  80.         $this->assertEquals($expected$this->Gtk_ScrollingLabel->getFullText());
  81.     }
  82.  
  83.     function testjumptochar()
  84.     {
  85.         $result   $this->Gtk_ScrollingLabel->jumptochar(4);
  86.         $expected = 4;
  87.         $this->assertEquals($expected$result);
  88.     }
  89.  
  90.     function testsetvisiblelength()
  91.     {
  92.         $result   $this->Gtk_ScrollingLabel->setvisiblelength(4);
  93.         $expected = 4;
  94.         $this->assertEquals($expected$result);
  95.     }
  96.  
  97.     function testgetvisiblelength()
  98.     {
  99.         $this->Gtk_ScrollingLabel->setvisiblelength(4);
  100.         $result   $this->Gtk_ScrollingLabel->getvisiblelength();
  101.         $expected = 4;
  102.         $this->assertEquals($expected$result);
  103.     }
  104.  
  105.     function testgetscrollinglabel()
  106.     {
  107.         $result   $this->Gtk_ScrollingLabel->getscrollinglabel();
  108.         $this->assertTrue(is_object($result));
  109.     }
  110.  
  111. }
  112. // Running the test.
  113. if (!extension_loaded('gtk')) {
  114.     dl'php_gtk.' . PHP_SHLIB_SUFFIX);
  115. }
  116. $suite  = new PHPUnit_TestSuite('Gtk_ScrollingLabelTest');
  117. $result = PHPUnit::run($suite);
  118. echo $result->toString();
  119. ?>

Documentation generated on Mon, 11 Mar 2019 14:31:37 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.