Documentation is available at ArithmeticFixture.php
- <?php
- # Copyright (c) 2002-2005 Cunningham & Cunningham, Inc.
- # Released under the terms of the GNU General Public License version 2 or later.
- #
- # PHP5 translation by Luis A. Floreani <luis.floreani@gmail.com>
- require_once Fixture::INCLUDE_DIR . DIRECTORY_SEPARATOR . 'PrimitiveFixture.php';
- class ArithmeticFixture extends PrimitiveFixture {
- public $x = 0;
- public $y = 0;
- public function doRows($rows) {
- parent::doRows($rows->more);
- }
- public function doCell($cell, $column) {
- switch($column) {
- case 0:
- $this->x = intval($cell->text());
- break;
- case 1: $this->y = intval($cell->text());
- break;
- case 2:
- $this->check($cell, intval($this->x+$this->y)); break;
- case 3:
- $this->check($cell, intval($this->x-$this->y)); break;
- case 4:
- $this->check($cell, intval($this->x*$this->y)); break;
- case 5:
- if ($this->y == 0)
- throw new Exception("ArithmeticException: / by zero");
- $this->check($cell, intval($this->x/$this->y));
- break;
- default: break;
- }
- }
- }
- ?>
Documentation generated on Sun, 02 Apr 2006 16:01:02 +0200 by phpDocumentor 1.3.0RC5