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

Source for file ArithmeticFixture.php

Documentation is available at ArithmeticFixture.php

  1. <?php
  2.  
  3. # Copyright (c) 2002-2005 Cunningham & Cunningham, Inc.
  4. # Released under the terms of the GNU General Public License version 2 or later.
  5. #
  6. # PHP5 translation by Luis A. Floreani <luis.floreani@gmail.com>
  7.  
  8. require_once 'Testing/FIT/Fixture/Primitive.php';
  9.  
  10. {
  11.     private $x = 0;
  12.     private $y = 0;
  13.     
  14.    /**
  15.     * iterate through rows but skip the first one
  16.     * 
  17.     * @param Parse $rows 
  18.     * @see doRow()
  19.     * @return boolean true on success
  20.     */
  21.     public function doRowsTesting_FIT_Node $node 
  22.     {
  23.         // start at second - the first simply contains the fixture with parameter
  24.         $node->next();
  25.         return parent::doRows$node );
  26.     }   
  27.  
  28.    /**
  29.     * process a single cell
  30.     *
  31.     * As this is a primitve fixture, it knows exactly what to do
  32.     * 
  33.     * @param object $cell A parse object
  34.     * @return boolean true on success
  35.     */
  36.     public function doCellTesting_FIT_Node $node  {
  37.     
  38.         switch$node->key() ) {
  39.             case 0:
  40.                 $this->intval$node->cData );
  41.                 break;
  42.             case 1:
  43.                 $this->intval$node->cData );
  44.                 break;
  45.             case 2:
  46.                 $this->_checkCell$node$this->$this->); break;
  47.                 break;
  48.             case 3:
  49.                 $this->_checkCell$node$this->$this->); break;
  50.                 break;
  51.             case 4:
  52.                 $this->_checkCell$node$this->$this->); break;
  53.                 break;
  54.             case 5:
  55.                 if$this->== 0 {
  56.                     throw new Exception'ArithmeticException: / by zero' );
  57.                 }               
  58.                 $this->_checkCell$node$this->$this->); break;
  59.                 break;
  60.                 
  61.             default:
  62.                 break;
  63.         }
  64.         
  65.         return true;
  66.     }
  67.  
  68. }
  69.  
  70. ?>

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