Fix some errors with samples

This commit is contained in:
Progi1984 2016-03-22 15:19:00 +01:00
parent 6e222bbdde
commit 73ac0aee35
74 changed files with 621 additions and 800 deletions

View File

@ -1489,7 +1489,7 @@ class DateTime
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject); return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject);
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::ExcelToPHP(PHPExcel\Shared\Date::PHPToExcel($PHPDateObject)); return (integer) \PHPExcel\Shared\Date::ExcelToPHP(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject));
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return $PHPDateObject; return $PHPDateObject;
} }

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Chart; namespace PHPExcel\Chart;
/** /**
* PHPExcel_Chart_DataSeriesValues * \PHPExcel\Chart\DataSeriesValues
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Chart; namespace PHPExcel\Chart;
/** /**
* PHPExcel_Chart_Layout * \PHPExcel\Chart\Layout
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Chart; namespace PHPExcel\Chart;
/** /**
* PHPExcel_Chart_Legend * \PHPExcel\Chart\Legend
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *

View File

@ -1,6 +1,7 @@
<?php <?php
namespace PHPExcel\Reader; namespace PHPExcel\Reader;
use PHPExcel\Spreadsheet; use PHPExcel\Spreadsheet;
/** /**
@ -232,8 +233,8 @@ class CSV extends BaseReader implements IReader
* Loads PHPExcel from file into PHPExcel instance * Loads PHPExcel from file into PHPExcel instance
* *
* @param string $pFilename * @param string $pFilename
* @param PHPExcel $objPHPExcel * @param Spreadsheet $objPHPExcel
* @return PHPExcel * @return Spreadsheet
* @throws Exception * @throws Exception
*/ */
public function loadIntoExisting($pFilename, Spreadsheet $objPHPExcel) public function loadIntoExisting($pFilename, Spreadsheet $objPHPExcel)

View File

@ -1,6 +1,7 @@
<?php <?php
namespace PHPExcel\Reader; namespace PHPExcel\Reader;
use PHPExcel\Shared\TimeZone;
/** /**
* PHPExcel_Reader_Excel2003XML * PHPExcel_Reader_Excel2003XML
@ -310,8 +311,8 @@ class Excel2003XML extends BaseReader implements IReader
\PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY \PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY
); );
$timezoneObj = new DateTimeZone('Europe/London'); $timezoneObj = new \DateTimeZone('Europe/London');
$GMT = new DateTimeZone('UTC'); $GMT = new \DateTimeZone('UTC');
// Check if file exists // Check if file exists
if (!file_exists($pFilename)) { if (!file_exists($pFilename)) {

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Shared; namespace PHPExcel\Shared;
/** /**
* PHPExcel_Shared_Date * \PHPExcel\Shared\Date
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Shared; namespace PHPExcel\Shared;
/** /**
* PHPExcel_Shared_Font * \PHPExcel\Shared\Font
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *

View File

@ -1,4 +1,7 @@
<?php <?php
namespace PHPExcel\Shared\JAMA;
/** /**
* @package JAMA * @package JAMA
* *
@ -73,7 +76,7 @@ class CholeskyDecomposition
} }
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); throw new \PHPExcel\Calculation\Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION));
} }
} // function __construct() } // function __construct()
@ -136,13 +139,13 @@ class CholeskyDecomposition
return new Matrix($X, $this->m, $nx); return new Matrix($X, $this->m, $nx);
} else { } else {
throw new PHPExcel_Calculation_Exception(JAMAError(MatrixSPDException)); throw new \PHPExcel\Calculation\Exception(JAMAError(MatrixSPDException));
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(JAMAError(MATRIX_DIMENSION_EXCEPTION)); throw new \PHPExcel\Calculation\Exception(JAMAError(MATRIX_DIMENSION_EXCEPTION));
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); throw new \PHPExcel\Calculation\Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION));
} }
} // function solve() } // function solve()
} }

View File

@ -1,4 +1,7 @@
<?php <?php
namespace PHPExcel\Shared\JAMA;
/** /**
* @package JAMA * @package JAMA
* *

View File

@ -1,4 +1,7 @@
<?php <?php
namespace PHPExcel\Shared\JAMA;
/** /**
* @package JAMA * @package JAMA
* *
@ -18,7 +21,7 @@
* @version 1.1 * @version 1.1
* @license PHP v3.0 * @license PHP v3.0
*/ */
class PHPExcel_Shared_JAMA_LUDecomposition class LUDecomposition
{ {
const MATRIX_SINGULAR_EXCEPTION = "Can only perform operation on singular matrix."; const MATRIX_SINGULAR_EXCEPTION = "Can only perform operation on singular matrix.";
const MATRIX_SQUARE_EXCEPTION = "Mismatched Row dimension"; const MATRIX_SQUARE_EXCEPTION = "Mismatched Row dimension";
@ -61,7 +64,7 @@ class PHPExcel_Shared_JAMA_LUDecomposition
*/ */
public function __construct($A) public function __construct($A)
{ {
if ($A instanceof PHPExcel_Shared_JAMA_Matrix) { if ($A instanceof Matrix) {
// Use a "left-looking", dot-product, Crout/Doolittle algorithm. // Use a "left-looking", dot-product, Crout/Doolittle algorithm.
$this->LU = $A->getArray(); $this->LU = $A->getArray();
$this->m = $A->getRowDimension(); $this->m = $A->getRowDimension();
@ -115,7 +118,7 @@ class PHPExcel_Shared_JAMA_LUDecomposition
} }
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(Matrix::ARGUMENT_TYPE_EXCEPTION);
} }
} // function __construct() } // function __construct()
@ -137,7 +140,7 @@ class PHPExcel_Shared_JAMA_LUDecomposition
} }
} }
} }
return new PHPExcel_Shared_JAMA_Matrix($L); return new Matrix($L);
} // function getL() } // function getL()
/** /**
@ -156,7 +159,7 @@ class PHPExcel_Shared_JAMA_LUDecomposition
} }
} }
} }
return new PHPExcel_Shared_JAMA_Matrix($U); return new Matrix($U);
} // function getU() } // function getU()
/** /**
@ -208,7 +211,7 @@ class PHPExcel_Shared_JAMA_LUDecomposition
} }
return $d; return $d;
} else { } else {
throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::MATRIX_DIMENSION_EXCEPTION); throw new \PHPExcel\Calculation\Exception(Matrix::MATRIX_DIMENSION_EXCEPTION);
} }
} // function det() } // function det()
@ -217,8 +220,8 @@ class PHPExcel_Shared_JAMA_LUDecomposition
* *
* @param $B A Matrix with as many rows as A and any number of columns. * @param $B A Matrix with as many rows as A and any number of columns.
* @return X so that L*U*X = B(piv,:) * @return X so that L*U*X = B(piv,:)
* @PHPExcel_Calculation_Exception IllegalArgumentException Matrix row dimensions must agree. * @\PHPExcel\Calculation\Exception IllegalArgumentException Matrix row dimensions must agree.
* @PHPExcel_Calculation_Exception RuntimeException Matrix is singular. * @\PHPExcel\Calculation\Exception RuntimeException Matrix is singular.
*/ */
public function solve($B) public function solve($B)
{ {
@ -248,10 +251,10 @@ class PHPExcel_Shared_JAMA_LUDecomposition
} }
return $X; return $X;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::MATRIX_SINGULAR_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::MATRIX_SINGULAR_EXCEPTION);
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(self::MATRIX_SQUARE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::MATRIX_SQUARE_EXCEPTION);
} }
} }
} }

View File

@ -1,17 +1,6 @@
<?php <?php
/**
* @package JAMA
*/
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Shared\JAMA;
/* /*
* Matrix class * Matrix class
@ -24,7 +13,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license PHP v3.0 * @license PHP v3.0
* @see http://math.nist.gov/javanumerics/jama/ * @see http://math.nist.gov/javanumerics/jama/
*/ */
class PHPExcel_Shared_JAMA_Matrix class Matrix
{ {
const POLYMORPHIC_ARGUMENT_EXCEPTION = "Invalid argument pattern for polymorphic function."; const POLYMORPHIC_ARGUMENT_EXCEPTION = "Invalid argument pattern for polymorphic function.";
const ARGUMENT_TYPE_EXCEPTION = "Invalid argument type."; const ARGUMENT_TYPE_EXCEPTION = "Invalid argument type.";
@ -101,15 +90,15 @@ class PHPExcel_Shared_JAMA_Matrix
} }
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARRAY_LENGTH_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARRAY_LENGTH_EXCEPTION);
} }
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -179,14 +168,14 @@ class PHPExcel_Shared_JAMA_Matrix
if ($i0 >= 0) { if ($i0 >= 0) {
$m = $this->m - $i0; $m = $this->m - $i0;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
} }
if ($j0 >= 0) { if ($j0 >= 0) {
$n = $this->n - $j0; $n = $this->n - $j0;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
} }
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n); $R = new Matrix($m, $n);
for ($i = $i0; $i < $this->m; ++$i) { for ($i = $i0; $i < $this->m; ++$i) {
for ($j = $j0; $j < $this->n; ++$j) { for ($j = $j0; $j < $this->n; ++$j) {
$R->set($i, $j, $this->A[$i][$j]); $R->set($i, $j, $this->A[$i][$j]);
@ -200,14 +189,14 @@ class PHPExcel_Shared_JAMA_Matrix
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
$m = $iF - $i0; $m = $iF - $i0;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
} }
if (($jF > $j0) && ($this->n >= $jF) && ($j0 >= 0)) { if (($jF > $j0) && ($this->n >= $jF) && ($j0 >= 0)) {
$n = $jF - $j0; $n = $jF - $j0;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
} }
$R = new PHPExcel_Shared_JAMA_Matrix($m+1, $n+1); $R = new Matrix($m+1, $n+1);
for ($i = $i0; $i <= $iF; ++$i) { for ($i = $i0; $i <= $iF; ++$i) {
for ($j = $j0; $j <= $jF; ++$j) { for ($j = $j0; $j <= $jF; ++$j) {
$R->set($i - $i0, $j - $j0, $this->A[$i][$j]); $R->set($i - $i0, $j - $j0, $this->A[$i][$j]);
@ -221,14 +210,14 @@ class PHPExcel_Shared_JAMA_Matrix
if (count($RL) > 0) { if (count($RL) > 0) {
$m = count($RL); $m = count($RL);
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
} }
if (count($CL) > 0) { if (count($CL) > 0) {
$n = count($CL); $n = count($CL);
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
} }
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n); $R = new Matrix($m, $n);
for ($i = 0; $i < $m; ++$i) { for ($i = 0; $i < $m; ++$i) {
for ($j = 0; $j < $n; ++$j) { for ($j = 0; $j < $n; ++$j) {
$R->set($i - $i0, $j - $j0, $this->A[$RL[$i]][$CL[$j]]); $R->set($i - $i0, $j - $j0, $this->A[$RL[$i]][$CL[$j]]);
@ -242,14 +231,14 @@ class PHPExcel_Shared_JAMA_Matrix
if (count($RL) > 0) { if (count($RL) > 0) {
$m = count($RL); $m = count($RL);
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
} }
if (count($CL) > 0) { if (count($CL) > 0) {
$n = count($CL); $n = count($CL);
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
} }
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n); $R = new Matrix($m, $n);
for ($i = 0; $i < $m; ++$i) { for ($i = 0; $i < $m; ++$i) {
for ($j = 0; $j < $n; ++$j) { for ($j = 0; $j < $n; ++$j) {
$R->set($i, $j, $this->A[$RL[$i]][$CL[$j]]); $R->set($i, $j, $this->A[$RL[$i]][$CL[$j]]);
@ -263,14 +252,14 @@ class PHPExcel_Shared_JAMA_Matrix
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
$m = $iF - $i0; $m = $iF - $i0;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
} }
if (count($CL) > 0) { if (count($CL) > 0) {
$n = count($CL); $n = count($CL);
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
} }
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n); $R = new Matrix($m, $n);
for ($i = $i0; $i < $iF; ++$i) { for ($i = $i0; $i < $iF; ++$i) {
for ($j = 0; $j < $n; ++$j) { for ($j = 0; $j < $n; ++$j) {
$R->set($i - $i0, $j, $this->A[$RL[$i]][$j]); $R->set($i - $i0, $j, $this->A[$RL[$i]][$j]);
@ -284,14 +273,14 @@ class PHPExcel_Shared_JAMA_Matrix
if (count($RL) > 0) { if (count($RL) > 0) {
$m = count($RL); $m = count($RL);
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
} }
if (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) { if (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) {
$n = $jF - $j0; $n = $jF - $j0;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
} }
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n+1); $R = new Matrix($m, $n+1);
for ($i = 0; $i < $m; ++$i) { for ($i = 0; $i < $m; ++$i) {
for ($j = $j0; $j <= $jF; ++$j) { for ($j = $j0; $j <= $jF; ++$j) {
$R->set($i, $j - $j0, $this->A[$RL[$i]][$j]); $R->set($i, $j - $j0, $this->A[$RL[$i]][$j]);
@ -300,11 +289,11 @@ class PHPExcel_Shared_JAMA_Matrix
return $R; return $R;
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -317,14 +306,14 @@ class PHPExcel_Shared_JAMA_Matrix
*/ */
public function checkMatrixDimensions($B = null) public function checkMatrixDimensions($B = null)
{ {
if ($B instanceof PHPExcel_Shared_JAMA_Matrix) { if ($B instanceof Matrix) {
if (($this->m == $B->getRowDimension()) && ($this->n == $B->getColumnDimension())) { if (($this->m == $B->getRowDimension()) && ($this->n == $B->getColumnDimension())) {
return true; return true;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::MATRIX_DIMENSION_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::MATRIX_DIMENSION_EXCEPTION);
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
} // function checkMatrixDimensions() } // function checkMatrixDimensions()
@ -367,7 +356,7 @@ class PHPExcel_Shared_JAMA_Matrix
*/ */
public function diagonal($m = null, $n = null, $c = 1) public function diagonal($m = null, $n = null, $c = 1)
{ {
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n); $R = new Matrix($m, $n);
for ($i = 0; $i < $m; ++$i) { for ($i = 0; $i < $m; ++$i) {
$R->set($i, $i, $c); $R->set($i, $i, $c);
} }
@ -391,7 +380,7 @@ class PHPExcel_Shared_JAMA_Matrix
return $this->getMatrix($i0, 0, $i0 + 1, $this->n); return $this->getMatrix($i0, 0, $i0 + 1, $this->n);
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
} }
@ -412,7 +401,7 @@ class PHPExcel_Shared_JAMA_Matrix
return $this->getMatrix(0, $j0, $this->m, $j0 + 1); return $this->getMatrix(0, $j0, $this->m, $j0 + 1);
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
} }
@ -424,7 +413,7 @@ class PHPExcel_Shared_JAMA_Matrix
*/ */
public function transpose() public function transpose()
{ {
$R = new PHPExcel_Shared_JAMA_Matrix($this->n, $this->m); $R = new Matrix($this->n, $this->m);
for ($i = 0; $i < $this->m; ++$i) { for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) { for ($j = 0; $j < $this->n; ++$j) {
$R->set($j, $i, $this->A[$i][$j]); $R->set($j, $i, $this->A[$i][$j]);
@ -474,17 +463,17 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$M = $args[0]; $M = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
break; break;
case 'array': case 'array':
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]); $M = new Matrix($args[0]);
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
$this->checkMatrixDimensions($M); $this->checkMatrixDimensions($M);
@ -495,7 +484,7 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $M; return $M;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -514,17 +503,17 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$M = $args[0]; $M = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
break; break;
case 'array': case 'array':
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]); $M = new Matrix($args[0]);
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
$this->checkMatrixDimensions($M); $this->checkMatrixDimensions($M);
@ -534,11 +523,11 @@ class PHPExcel_Shared_JAMA_Matrix
$value = $M->get($i, $j); $value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j], '"'); $this->A[$i][$j] = trim($this->A[$i][$j], '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($this->A[$i][$j]);
} }
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value, '"'); $value = trim($value, '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($value);
} }
if ($validValues) { if ($validValues) {
$this->A[$i][$j] += $value; $this->A[$i][$j] += $value;
@ -549,7 +538,7 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $this; return $this;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -568,17 +557,17 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$M = $args[0]; $M = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
break; break;
case 'array': case 'array':
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]); $M = new Matrix($args[0]);
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
$this->checkMatrixDimensions($M); $this->checkMatrixDimensions($M);
@ -589,7 +578,7 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $M; return $M;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -608,17 +597,17 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$M = $args[0]; $M = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
break; break;
case 'array': case 'array':
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]); $M = new Matrix($args[0]);
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
$this->checkMatrixDimensions($M); $this->checkMatrixDimensions($M);
@ -628,11 +617,11 @@ class PHPExcel_Shared_JAMA_Matrix
$value = $M->get($i, $j); $value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j], '"'); $this->A[$i][$j] = trim($this->A[$i][$j], '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($this->A[$i][$j]);
} }
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value, '"'); $value = trim($value, '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($value);
} }
if ($validValues) { if ($validValues) {
$this->A[$i][$j] -= $value; $this->A[$i][$j] -= $value;
@ -643,7 +632,7 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $this; return $this;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -663,17 +652,17 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$M = $args[0]; $M = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
break; break;
case 'array': case 'array':
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]); $M = new Matrix($args[0]);
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
$this->checkMatrixDimensions($M); $this->checkMatrixDimensions($M);
@ -684,7 +673,7 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $M; return $M;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -704,17 +693,17 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$M = $args[0]; $M = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
break; break;
case 'array': case 'array':
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]); $M = new Matrix($args[0]);
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
$this->checkMatrixDimensions($M); $this->checkMatrixDimensions($M);
@ -724,11 +713,11 @@ class PHPExcel_Shared_JAMA_Matrix
$value = $M->get($i, $j); $value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j], '"'); $this->A[$i][$j] = trim($this->A[$i][$j], '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($this->A[$i][$j]);
} }
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value, '"'); $value = trim($value, '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($value);
} }
if ($validValues) { if ($validValues) {
$this->A[$i][$j] *= $value; $this->A[$i][$j] *= $value;
@ -739,7 +728,7 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $this; return $this;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -759,17 +748,17 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$M = $args[0]; $M = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
break; break;
case 'array': case 'array':
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]); $M = new Matrix($args[0]);
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
$this->checkMatrixDimensions($M); $this->checkMatrixDimensions($M);
@ -779,11 +768,11 @@ class PHPExcel_Shared_JAMA_Matrix
$value = $M->get($i, $j); $value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j], '"'); $this->A[$i][$j] = trim($this->A[$i][$j], '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($this->A[$i][$j]);
} }
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value, '"'); $value = trim($value, '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($value);
} }
if ($validValues) { if ($validValues) {
if ($value == 0) { if ($value == 0) {
@ -799,7 +788,7 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $M; return $M;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -820,17 +809,17 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$M = $args[0]; $M = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
break; break;
case 'array': case 'array':
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]); $M = new Matrix($args[0]);
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
$this->checkMatrixDimensions($M); $this->checkMatrixDimensions($M);
@ -841,7 +830,7 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $M; return $M;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -862,17 +851,17 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$M = $args[0]; $M = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
break; break;
case 'array': case 'array':
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]); $M = new Matrix($args[0]);
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
$this->checkMatrixDimensions($M); $this->checkMatrixDimensions($M);
@ -883,7 +872,7 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $M; return $M;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -904,17 +893,17 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$M = $args[0]; $M = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
break; break;
case 'array': case 'array':
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]); $M = new Matrix($args[0]);
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
$this->checkMatrixDimensions($M); $this->checkMatrixDimensions($M);
@ -925,7 +914,7 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $M; return $M;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -945,13 +934,13 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$B = $args[0]; $B = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
if ($this->n == $B->m) { if ($this->n == $B->m) {
$C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n); $C = new Matrix($this->m, $B->n);
for ($j = 0; $j < $B->n; ++$j) { for ($j = 0; $j < $B->n; ++$j) {
for ($k = 0; $k < $this->n; ++$k) { for ($k = 0; $k < $this->n; ++$k) {
$Bcolj[$k] = $B->A[$k][$j]; $Bcolj[$k] = $B->A[$k][$j];
@ -967,13 +956,13 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $C; return $C;
} else { } else {
throw new PHPExcel_Calculation_Exception(JAMAError(MatrixDimensionMismatch)); throw new \PHPExcel\Calculation\Exception(JAMAError(MatrixDimensionMismatch));
} }
break; break;
case 'array': case 'array':
$B = new PHPExcel_Shared_JAMA_Matrix($args[0]); $B = new Matrix($args[0]);
if ($this->n == $B->m) { if ($this->n == $B->m) {
$C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n); $C = new Matrix($this->m, $B->n);
for ($i = 0; $i < $C->m; ++$i) { for ($i = 0; $i < $C->m; ++$i) {
for ($j = 0; $j < $C->n; ++$j) { for ($j = 0; $j < $C->n; ++$j) {
$s = "0"; $s = "0";
@ -985,12 +974,12 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $C; return $C;
} else { } else {
throw new PHPExcel_Calculation_Exception(JAMAError(MatrixDimensionMismatch)); throw new \PHPExcel\Calculation\Exception(JAMAError(MatrixDimensionMismatch));
} }
return $M; return $M;
break; break;
case 'integer': case 'integer':
$C = new PHPExcel_Shared_JAMA_Matrix($this->A); $C = new Matrix($this->A);
for ($i = 0; $i < $C->m; ++$i) { for ($i = 0; $i < $C->m; ++$i) {
for ($j = 0; $j < $C->n; ++$j) { for ($j = 0; $j < $C->n; ++$j) {
$C->A[$i][$j] *= $args[0]; $C->A[$i][$j] *= $args[0];
@ -999,7 +988,7 @@ class PHPExcel_Shared_JAMA_Matrix
return $C; return $C;
break; break;
case 'double': case 'double':
$C = new PHPExcel_Shared_JAMA_Matrix($this->m, $this->n); $C = new Matrix($this->m, $this->n);
for ($i = 0; $i < $C->m; ++$i) { for ($i = 0; $i < $C->m; ++$i) {
for ($j = 0; $j < $C->n; ++$j) { for ($j = 0; $j < $C->n; ++$j) {
$C->A[$i][$j] = $args[0] * $this->A[$i][$j]; $C->A[$i][$j] = $args[0] * $this->A[$i][$j];
@ -1008,7 +997,7 @@ class PHPExcel_Shared_JAMA_Matrix
return $C; return $C;
break; break;
case 'float': case 'float':
$C = new PHPExcel_Shared_JAMA_Matrix($this->A); $C = new Matrix($this->A);
for ($i = 0; $i < $C->m; ++$i) { for ($i = 0; $i < $C->m; ++$i) {
for ($j = 0; $j < $C->n; ++$j) { for ($j = 0; $j < $C->n; ++$j) {
$C->A[$i][$j] *= $args[0]; $C->A[$i][$j] *= $args[0];
@ -1017,11 +1006,11 @@ class PHPExcel_Shared_JAMA_Matrix
return $C; return $C;
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -1040,17 +1029,17 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$M = $args[0]; $M = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
break; break;
case 'array': case 'array':
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]); $M = new Matrix($args[0]);
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
$this->checkMatrixDimensions($M); $this->checkMatrixDimensions($M);
@ -1060,11 +1049,11 @@ class PHPExcel_Shared_JAMA_Matrix
$value = $M->get($i, $j); $value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j], '"'); $this->A[$i][$j] = trim($this->A[$i][$j], '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($this->A[$i][$j]);
} }
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value, '"'); $value = trim($value, '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($value);
} }
if ($validValues) { if ($validValues) {
$this->A[$i][$j] = pow($this->A[$i][$j], $value); $this->A[$i][$j] = pow($this->A[$i][$j], $value);
@ -1075,7 +1064,7 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $this; return $this;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -1094,16 +1083,16 @@ class PHPExcel_Shared_JAMA_Matrix
switch ($match) { switch ($match) {
case 'object': case 'object':
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { if ($args[0] instanceof Matrix) {
$M = $args[0]; $M = $args[0];
} else { } else {
throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION);
} }
case 'array': case 'array':
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]); $M = new Matrix($args[0]);
break; break;
default: default:
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
break; break;
} }
$this->checkMatrixDimensions($M); $this->checkMatrixDimensions($M);
@ -1114,7 +1103,7 @@ class PHPExcel_Shared_JAMA_Matrix
} }
return $this; return $this;
} else { } else {
throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
} }
} }
@ -1127,7 +1116,7 @@ class PHPExcel_Shared_JAMA_Matrix
public function solve($B) public function solve($B)
{ {
if ($this->m == $this->n) { if ($this->m == $this->n) {
$LU = new PHPExcel_Shared_JAMA_LUDecomposition($this); $LU = new LUDecomposition($this);
return $LU->solve($B); return $LU->solve($B);
} else { } else {
$QR = new PHPExcel_Shared_JAMA_QRDecomposition($this); $QR = new PHPExcel_Shared_JAMA_QRDecomposition($this);
@ -1153,7 +1142,7 @@ class PHPExcel_Shared_JAMA_Matrix
*/ */
public function det() public function det()
{ {
$L = new PHPExcel_Shared_JAMA_LUDecomposition($this); $L = new LUDecomposition($this);
return $L->det(); return $L->det();
} }
} }

View File

@ -1,4 +1,7 @@
<?php <?php
namespace PHPExcel\Shared\JAMA;
/** /**
* @package JAMA * @package JAMA
* *
@ -16,7 +19,7 @@
* @license PHP v3.0 * @license PHP v3.0
* @version 1.1 * @version 1.1
*/ */
class PHPExcel_Shared_JAMA_QRDecomposition class QRDecomposition
{ {
const MATRIX_RANK_EXCEPTION = "Can only perform operation on full-rank matrix."; const MATRIX_RANK_EXCEPTION = "Can only perform operation on full-rank matrix.";
@ -53,7 +56,7 @@ class PHPExcel_Shared_JAMA_QRDecomposition
*/ */
public function __construct($A) public function __construct($A)
{ {
if ($A instanceof PHPExcel_Shared_JAMA_Matrix) { if ($A instanceof Matrix) {
// Initialize. // Initialize.
$this->QR = $A->getArrayCopy(); $this->QR = $A->getArrayCopy();
$this->m = $A->getRowDimension(); $this->m = $A->getRowDimension();
@ -89,7 +92,7 @@ class PHPExcel_Shared_JAMA_QRDecomposition
$this->Rdiag[$k] = -$nrm; $this->Rdiag[$k] = -$nrm;
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::ARGUMENT_TYPE_EXCEPTION); throw new \PHPExcel\Calculation\Exception(Matrix::ARGUMENT_TYPE_EXCEPTION);
} }
} // function __construct() } // function __construct()
@ -125,7 +128,7 @@ class PHPExcel_Shared_JAMA_QRDecomposition
} }
} }
} }
return new PHPExcel_Shared_JAMA_Matrix($H); return new Matrix($H);
} // function getH() } // function getH()
/** /**
@ -146,7 +149,7 @@ class PHPExcel_Shared_JAMA_QRDecomposition
} }
} }
} }
return new PHPExcel_Shared_JAMA_Matrix($R); return new Matrix($R);
} // function getR() } // function getR()
/** /**
@ -183,7 +186,7 @@ class PHPExcel_Shared_JAMA_QRDecomposition
} }
} }
*/ */
return new PHPExcel_Shared_JAMA_Matrix($Q); return new Matrix($Q);
} // function getQ() } // function getQ()
/** /**
@ -223,13 +226,13 @@ class PHPExcel_Shared_JAMA_QRDecomposition
} }
} }
} }
$X = new PHPExcel_Shared_JAMA_Matrix($X); $X = new Matrix($X);
return ($X->getMatrix(0, $this->n-1, 0, $nx)); return ($X->getMatrix(0, $this->n-1, 0, $nx));
} else { } else {
throw new PHPExcel_Calculation_Exception(self::MATRIX_RANK_EXCEPTION); throw new \PHPExcel\Calculation\Exception(self::MATRIX_RANK_EXCEPTION);
} }
} else { } else {
throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::MATRIX_DIMENSION_EXCEPTION); throw new \PHPExcel\Calculation\Exception(Matrix::MATRIX_DIMENSION_EXCEPTION);
} }
} }
} }

View File

@ -1,4 +1,7 @@
<?php <?php
namespace PHPExcel\Shared\JAMA;
/** /**
* @package JAMA * @package JAMA
* *

View File

@ -36,7 +36,7 @@ function hypot() {
if (is_numeric($d)) { if (is_numeric($d)) {
$s += pow($d, 2); $s += pow($d, 2);
} else { } else {
throw new PHPExcel_Calculation_Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); throw new \PHPExcel\Calculation\Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION));
} }
} }
return sqrt($s); return sqrt($s);

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Shared; namespace PHPExcel\Shared;
/** /**
* PHPExcel_Shared_String * \PHPExcel\Shared\String
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Shared; namespace PHPExcel\Shared;
/** /**
* PHPExcel_Shared_TimeZone * \PHPExcel\Shared\TimeZone
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -45,7 +45,7 @@ class TimeZone
*/ */
private static function validateTimeZone($timezone) private static function validateTimeZone($timezone)
{ {
if (in_array($timezone, DateTimeZone::listIdentifiers())) { if (in_array($timezone, \DateTimeZone::listIdentifiers())) {
return true; return true;
} }
return false; return false;

View File

@ -22,7 +22,7 @@ namespace PHPExcel;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_AutoFilter * \PHPExcel\Worksheet\AutoFilter
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet\AutoFilter; namespace PHPExcel\Worksheet\AutoFilter;
/** /**
* PHPExcel_Worksheet_AutoFilter_Column * \PHPExcel\Worksheet\AutoFilter\Column
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet\AutoFilter;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet\AutoFilter\Column; namespace PHPExcel\Worksheet\AutoFilter\Column;
/** /**
* PHPExcel_Worksheet_AutoFilter_Column_Rule * \PHPExcel\Worksheet\AutoFilter\Column\Rule
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet\AutoFilter\Column;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_BaseDrawing * \PHPExcel\Worksheet_BaseDrawing
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_CellIterator * \PHPExcel\Worksheet_CellIterator
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_Column * \PHPExcel\Worksheet\Column
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_ColumnCellIterator * \PHPExcel\Worksheet\ColumnCellIterator
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_ColumnDimension * \PHPExcel\Worksheet\ColumnDimension
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -1,9 +1,11 @@
<?php <?php
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
use PHPExcel\Cell;
use PHPExcel\Exception;
/** /**
* PHPExcel_Worksheet_ColumnIterator * \PHPExcel\Worksheet\ColumnIterator
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +24,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
@ -87,13 +89,13 @@ class ColumnIterator implements \Iterator
* *
* @param integer $startColumn The column address at which to start iterating * @param integer $startColumn The column address at which to start iterating
* @return ColumnIterator * @return ColumnIterator
* @throws PHPExcel_Exception * @throws Exception
*/ */
public function resetStart($startColumn = 'A') public function resetStart($startColumn = 'A')
{ {
$startColumnIndex = \PHPExcel\Cell::columnIndexFromString($startColumn) - 1; $startColumnIndex = \PHPExcel\Cell::columnIndexFromString($startColumn) - 1;
if ($startColumnIndex > PHPExcel_Cell::columnIndexFromString($this->subject->getHighestColumn()) - 1) { if ($startColumnIndex > Cell::columnIndexFromString($this->subject->getHighestColumn()) - 1) {
throw new PHPExcel_Exception("Start column ({$startColumn}) is beyond highest column ({$this->subject->getHighestColumn()})"); throw new Exception("Start column ({$startColumn}) is beyond highest column ({$this->subject->getHighestColumn()})");
} }
$this->startColumn = $startColumnIndex; $this->startColumn = $startColumnIndex;

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_Dimension * \PHPExcel\Worksheet_Dimension
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_Drawing * \PHPExcel\Worksheet_Drawing
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet_Drawing * @package \PHPExcel\Worksheet_Drawing
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet\Drawing; namespace PHPExcel\Worksheet\Drawing;
/** /**
* PHPExcel_Worksheet_Drawing_Shadow * \PHPExcel\Worksheet_Drawing_Shadow
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet\Drawing;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet_Drawing * @package \PHPExcel\Worksheet_Drawing
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_HeaderFooter * \PHPExcel\Worksheet_HeaderFooter
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_HeaderFooterDrawing * \PHPExcel\Worksheet_HeaderFooterDrawing
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_MemoryDrawing * \PHPExcel\Worksheet_MemoryDrawing
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
@ -99,7 +99,7 @@ namespace PHPExcel\Worksheet;
* </code> * </code>
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PageSetup class PageSetup

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_Protection * \PHPExcel\Worksheet_Protection
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_Row * \PHPExcel\Worksheet\Row
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_RowCellIterator * \PHPExcel\Worksheet\RowCellIterator
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_RowDimension * \PHPExcel\Worksheet\RowDimension
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_RowIterator * \PHPExcel\Worksheet\RowIterator
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -3,7 +3,7 @@
namespace PHPExcel\Worksheet; namespace PHPExcel\Worksheet;
/** /**
* PHPExcel_Worksheet_SheetView * \PHPExcel\Worksheet_SheetView
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet;
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Worksheet * @package \PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##

View File

@ -1,5 +1,6 @@
<?php <?php
namespace PHPExcel\Writer\Excel2007; namespace PHPExcel\Writer\Excel2007;
use PHPExcel\Chart\Axis; use PHPExcel\Chart\Axis;
use PHPExcel\Chart\DataSeries; use PHPExcel\Chart\DataSeries;
use PHPExcel\Chart\DataSeriesValues; use PHPExcel\Chart\DataSeriesValues;
@ -357,7 +358,7 @@ class Chart extends WriterPart
* Write Data Labels * Write Data Labels
* *
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
* @param PHPExcel_Chart_Layout $chartLayout Chart layout * @param \PHPExcel\Chart\Layout $chartLayout Chart layout
* *
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
@ -1190,7 +1191,7 @@ class Chart extends WriterPart
$objWriter->startElement('c:cat'); $objWriter->startElement('c:cat');
} }
$this->writePlotSeriesValues($plotSeriesCategory, $objWriter, $groupType, 'str', $pSheet); $this->writePlotSeriesValues($plotSeriesCategory, $objWriter, $groupType, 'str');
$objWriter->endElement(); $objWriter->endElement();
} }
@ -1204,12 +1205,12 @@ class Chart extends WriterPart
$objWriter->startElement('c:val'); $objWriter->startElement('c:val');
} }
$this->writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, 'num', $pSheet); $this->writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, 'num');
$objWriter->endElement(); $objWriter->endElement();
} }
if ($groupType === DataSeries::TYPE_BUBBLECHART) { if ($groupType === DataSeries::TYPE_BUBBLECHART) {
$this->writeBubbles($plotSeriesValues, $objWriter, $pSheet); $this->writeBubbles($plotSeriesValues, $objWriter);
} }
$objWriter->endElement(); $objWriter->endElement();
@ -1264,7 +1265,7 @@ class Chart extends WriterPart
* *
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, $dataType = 'str', \PHPExcel\Worksheet $pSheet) private function writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, $dataType = 'str')
{ {
if (is_null($plotSeriesValues)) { if (is_null($plotSeriesValues)) {
return; return;
@ -1356,7 +1357,7 @@ class Chart extends WriterPart
* *
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeBubbles($plotSeriesValues, $objWriter, \PHPExcel\Worksheet $pSheet) private function writeBubbles($plotSeriesValues, $objWriter)
{ {
if (is_null($plotSeriesValues)) { if (is_null($plotSeriesValues)) {
return; return;

View File

@ -39,7 +39,6 @@ class Workbook extends WriterPart
public function writeWorkbook(\PHPExcel\SpreadSheet $pPHPExcel = null, $recalcRequired = false) public function writeWorkbook(\PHPExcel\SpreadSheet $pPHPExcel = null, $recalcRequired = false)
{ {
// Create XML writer // Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) { if ($this->getParentWriter()->getUseDiskCaching()) {
$objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else { } else {
@ -90,7 +89,7 @@ class Workbook extends WriterPart
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeFileVersion(\PHPExcel\Shared\XMLWriter $objWriter = null) private function writeFileVersion(\PHPExcel\Shared\XMLWriter $objWriter)
{ {
$objWriter->startElement('fileVersion'); $objWriter->startElement('fileVersion');
$objWriter->writeAttribute('appName', 'xl'); $objWriter->writeAttribute('appName', 'xl');
@ -106,7 +105,7 @@ class Workbook extends WriterPart
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeWorkbookPr(\PHPExcel\Shared\XMLWriter $objWriter = null) private function writeWorkbookPr(\PHPExcel\Shared\XMLWriter $objWriter)
{ {
$objWriter->startElement('workbookPr'); $objWriter->startElement('workbookPr');
@ -126,7 +125,7 @@ class Workbook extends WriterPart
* @param PHPExcel $pPHPExcel * @param PHPExcel $pPHPExcel
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeBookViews(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\SpreadSheet $pPHPExcel = null) private function writeBookViews(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\SpreadSheet $pPHPExcel = null)
{ {
// bookViews // bookViews
$objWriter->startElement('bookViews'); $objWriter->startElement('bookViews');
@ -156,7 +155,7 @@ class Workbook extends WriterPart
* @param PHPExcel $pPHPExcel * @param PHPExcel $pPHPExcel
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeWorkbookProtection(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\SpreadSheet $pPHPExcel = null) private function writeWorkbookProtection(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\SpreadSheet $pPHPExcel = null)
{ {
if ($pPHPExcel->getSecurity()->isSecurityEnabled()) { if ($pPHPExcel->getSecurity()->isSecurityEnabled()) {
$objWriter->startElement('workbookProtection'); $objWriter->startElement('workbookProtection');
@ -183,7 +182,7 @@ class Workbook extends WriterPart
* @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing * @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeCalcPr(\PHPExcel\Shared\XMLWriter $objWriter = null, $recalcRequired = true) private function writeCalcPr(\PHPExcel\Shared\XMLWriter $objWriter, $recalcRequired = true)
{ {
$objWriter->startElement('calcPr'); $objWriter->startElement('calcPr');
@ -206,7 +205,7 @@ class Workbook extends WriterPart
* @param PHPExcel $pPHPExcel * @param PHPExcel $pPHPExcel
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeSheets(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\SpreadSheet $pPHPExcel = null) private function writeSheets(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\SpreadSheet $pPHPExcel = null)
{ {
// Write sheets // Write sheets
$objWriter->startElement('sheets'); $objWriter->startElement('sheets');
@ -235,7 +234,7 @@ class Workbook extends WriterPart
* @param string $sheetState Sheet state (visible, hidden, veryHidden) * @param string $sheetState Sheet state (visible, hidden, veryHidden)
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeSheet(\PHPExcel\Shared\XMLWriter $objWriter = null, $pSheetname = '', $pSheetId = 1, $pRelId = 1, $sheetState = 'visible') private function writeSheet(\PHPExcel\Shared\XMLWriter $objWriter, $pSheetname = '', $pSheetId = 1, $pRelId = 1, $sheetState = 'visible')
{ {
if ($pSheetname != '') { if ($pSheetname != '') {
// Write sheet // Write sheet
@ -259,7 +258,7 @@ class Workbook extends WriterPart
* @param PHPExcel $pPHPExcel * @param PHPExcel $pPHPExcel
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeDefinedNames(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\SpreadSheet $pPHPExcel = null) private function writeDefinedNames(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\SpreadSheet $pPHPExcel = null)
{ {
// Write defined names // Write defined names
$objWriter->startElement('definedNames'); $objWriter->startElement('definedNames');
@ -290,10 +289,10 @@ class Workbook extends WriterPart
* Write named ranges * Write named ranges
* *
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
* @param PHPExcel $pPHPExcel * @param \PHPExcel\SpreadSheet $pPHPExcel
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeNamedRanges(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\SpreadSheet $pPHPExcel) private function writeNamedRanges(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\SpreadSheet $pPHPExcel)
{ {
// Loop named ranges // Loop named ranges
$namedRanges = $pPHPExcel->getNamedRanges(); $namedRanges = $pPHPExcel->getNamedRanges();
@ -309,7 +308,7 @@ class Workbook extends WriterPart
* @param \PHPExcel\NamedRange $pNamedRange * @param \PHPExcel\NamedRange $pNamedRange
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeDefinedNameForNamedRange(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\NamedRange $pNamedRange) private function writeDefinedNameForNamedRange(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\NamedRange $pNamedRange)
{ {
// definedName for named range // definedName for named range
$objWriter->startElement('definedName'); $objWriter->startElement('definedName');
@ -341,7 +340,7 @@ class Workbook extends WriterPart
* @param int $pSheetId * @param int $pSheetId
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeDefinedNameForAutofilter(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null, $pSheetId = 0) private function writeDefinedNameForAutofilter(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\Worksheet $pSheet = null, $pSheetId = 0)
{ {
// definedName for autoFilter // definedName for autoFilter
$autoFilterRange = $pSheet->getAutoFilter()->getRange(); $autoFilterRange = $pSheet->getAutoFilter()->getRange();
@ -377,7 +376,7 @@ class Workbook extends WriterPart
* @param int $pSheetId * @param int $pSheetId
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeDefinedNameForPrintTitles(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null, $pSheetId = 0) private function writeDefinedNameForPrintTitles(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\Worksheet $pSheet = null, $pSheetId = 0)
{ {
// definedName for PrintTitles // definedName for PrintTitles
if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet() || $pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) { if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet() || $pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) {
@ -420,7 +419,7 @@ class Workbook extends WriterPart
* @param int $pSheetId * @param int $pSheetId
* @throws \PHPExcel\Writer\Exception * @throws \PHPExcel\Writer\Exception
*/ */
private function writeDefinedNameForPrintArea(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null, $pSheetId = 0) private function writeDefinedNameForPrintArea(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\Worksheet $pSheet = null, $pSheetId = 0)
{ {
// definedName for PrintArea // definedName for PrintArea
if ($pSheet->getPageSetup()->isPrintAreaSet()) { if ($pSheet->getPageSetup()->isPrintAreaSet()) {

View File

@ -1,6 +1,7 @@
<?php <?php
namespace PHPExcel\Writer; namespace PHPExcel\Writer;
use PHPExcel\Calculation; use PHPExcel\Calculation;
use PHPExcel\Shared\Font; use PHPExcel\Shared\Font;
use PHPExcel\Shared\String; use PHPExcel\Shared\String;
@ -36,7 +37,7 @@ class HTML extends BaseWriter implements IWriter
/** /**
* PHPExcel object * PHPExcel object
* *
* @var PHPExcel * @var Spreadsheet
*/ */
protected $phpExcel; protected $phpExcel;
@ -291,7 +292,7 @@ class HTML extends BaseWriter implements IWriter
* Set sheet index * Set sheet index
* *
* @param int $pValue Sheet index * @param int $pValue Sheet index
* @return PHPExcel_Writer_HTML * @return HTML
*/ */
public function setSheetIndex($pValue = 0) public function setSheetIndex($pValue = 0)
{ {
@ -313,7 +314,7 @@ class HTML extends BaseWriter implements IWriter
* Set sheet index * Set sheet index
* *
* @param boolean $pValue Flag indicating whether the sheet navigation block should be generated or not * @param boolean $pValue Flag indicating whether the sheet navigation block should be generated or not
* @return PHPExcel_Writer_HTML * @return HTML
*/ */
public function setGenerateSheetNavigationBlock($pValue = true) public function setGenerateSheetNavigationBlock($pValue = true)
{ {

View File

@ -8,12 +8,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL);
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
} }
/** /**
@ -23,7 +18,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'DATE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'DATE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -34,17 +29,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
public function testDATEtoPHP() public function testDATEtoPHP()
{ {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::DATE(2012, 1, 31); $result = \PHPExcel\Calculation\DateTime::DATE(2012, 1, 31);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
$this->assertEquals(1327968000, $result, null, 1E-8); $this->assertEquals(1327968000, $result, null, 1E-8);
} }
public function testDATEtoPHPObject() public function testDATEtoPHPObject()
{ {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::DATE(2012, 1, 31); $result = \PHPExcel\Calculation\DateTime::DATE(2012, 1, 31);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
// Must return an object... // Must return an object...
$this->assertTrue(is_object($result)); $this->assertTrue(is_object($result));
// ... of the correct type // ... of the correct type
@ -55,17 +50,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
public function testDATEwith1904Calendar() public function testDATEwith1904Calendar()
{ {
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904); \PHPExcel\Shared\Date::setExcelCalendar(\PHPExcel\Shared\Date::CALENDAR_MAC_1904);
$result = PHPExcel_Calculation_DateTime::DATE(1918, 11, 11); $result = \PHPExcel\Calculation\DateTime::DATE(1918, 11, 11);
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900); \PHPExcel\Shared\Date::setExcelCalendar(\PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900);
$this->assertEquals($result, 5428); $this->assertEquals($result, 5428);
} }
public function testDATEwith1904CalendarError() public function testDATEwith1904CalendarError()
{ {
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904); \PHPExcel\Shared\Date::setExcelCalendar(\PHPExcel\Shared\Date::CALENDAR_MAC_1904);
$result = PHPExcel_Calculation_DateTime::DATE(1901, 1, 31); $result = \PHPExcel\Calculation\DateTime::DATE(1901, 1, 31);
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900); \PHPExcel\Shared\Date::setExcelCalendar(\PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900);
$this->assertEquals($result, '#NUM!'); $this->assertEquals($result, '#NUM!');
} }
@ -76,7 +71,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'DATEVALUE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'DATEVALUE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -87,17 +82,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
public function testDATEVALUEtoPHP() public function testDATEVALUEtoPHP()
{ {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31'); $result = \PHPExcel\Calculation\DateTime::DATEVALUE('2012-1-31');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
$this->assertEquals(1327968000, $result, null, 1E-8); $this->assertEquals(1327968000, $result, null, 1E-8);
} }
public function testDATEVALUEtoPHPObject() public function testDATEVALUEtoPHPObject()
{ {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31'); $result = \PHPExcel\Calculation\DateTime::DATEVALUE('2012-1-31');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
// Must return an object... // Must return an object...
$this->assertTrue(is_object($result)); $this->assertTrue(is_object($result));
// ... of the correct type // ... of the correct type
@ -113,7 +108,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'YEAR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'YEAR'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -129,7 +124,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'MONTHOFYEAR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'MONTHOFYEAR'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -145,7 +140,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'WEEKOFYEAR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'WEEKOFYEAR'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -161,7 +156,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'DAYOFWEEK'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'DAYOFWEEK'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -177,7 +172,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'DAYOFMONTH'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'DAYOFMONTH'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -193,7 +188,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'TIME'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'TIME'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -204,17 +199,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
public function testTIMEtoPHP() public function testTIMEtoPHP()
{ {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::TIME(7, 30, 20); $result = \PHPExcel\Calculation\DateTime::TIME(7, 30, 20);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
$this->assertEquals(27020, $result, null, 1E-8); $this->assertEquals(27020, $result, null, 1E-8);
} }
public function testTIMEtoPHPObject() public function testTIMEtoPHPObject()
{ {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::TIME(7, 30, 20); $result = \PHPExcel\Calculation\DateTime::TIME(7, 30, 20);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
// Must return an object... // Must return an object...
$this->assertTrue(is_object($result)); $this->assertTrue(is_object($result));
// ... of the correct type // ... of the correct type
@ -230,7 +225,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'TIMEVALUE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'TIMEVALUE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -241,17 +236,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
public function testTIMEVALUEtoPHP() public function testTIMEVALUEtoPHP()
{ {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20'); $result = \PHPExcel\Calculation\DateTime::TIMEVALUE('7:30:20');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
$this->assertEquals(23420, $result, null, 1E-8); $this->assertEquals(23420, $result, null, 1E-8);
} }
public function testTIMEVALUEtoPHPObject() public function testTIMEVALUEtoPHPObject()
{ {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20'); $result = \PHPExcel\Calculation\DateTime::TIMEVALUE('7:30:20');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
// Must return an object... // Must return an object...
$this->assertTrue(is_object($result)); $this->assertTrue(is_object($result));
// ... of the correct type // ... of the correct type
@ -267,7 +262,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'HOUROFDAY'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'HOUROFDAY'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -283,7 +278,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'MINUTEOFHOUR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'MINUTEOFHOUR'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -299,7 +294,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'SECONDOFMINUTE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'SECONDOFMINUTE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -315,7 +310,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'NETWORKDAYS'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'NETWORKDAYS'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -331,7 +326,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'WORKDAY'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'WORKDAY'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -347,7 +342,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'EDATE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'EDATE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -358,17 +353,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
public function testEDATEtoPHP() public function testEDATEtoPHP()
{ {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26', -1); $result = \PHPExcel\Calculation\DateTime::EDATE('2012-1-26', -1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
$this->assertEquals(1324857600, $result, null, 1E-8); $this->assertEquals(1324857600, $result, null, 1E-8);
} }
public function testEDATEtoPHPObject() public function testEDATEtoPHPObject()
{ {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26', -1); $result = \PHPExcel\Calculation\DateTime::EDATE('2012-1-26', -1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
// Must return an object... // Must return an object...
$this->assertTrue(is_object($result)); $this->assertTrue(is_object($result));
// ... of the correct type // ... of the correct type
@ -384,7 +379,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'EOMONTH'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'EOMONTH'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -395,17 +390,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
public function testEOMONTHtoPHP() public function testEOMONTHtoPHP()
{ {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26', -1); $result = \PHPExcel\Calculation\DateTime::EOMONTH('2012-1-26', -1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
$this->assertEquals(1325289600, $result, null, 1E-8); $this->assertEquals(1325289600, $result, null, 1E-8);
} }
public function testEOMONTHtoPHPObject() public function testEOMONTHtoPHPObject()
{ {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26', -1); $result = \PHPExcel\Calculation\DateTime::EOMONTH('2012-1-26', -1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL);
// Must return an object... // Must return an object...
$this->assertTrue(is_object($result)); $this->assertTrue(is_object($result));
// ... of the correct type // ... of the correct type
@ -421,7 +416,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'DATEDIF'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'DATEDIF'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -437,7 +432,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'DAYS360'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'DAYS360'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -453,7 +448,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'YEARFRAC'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\DateTime', 'YEARFRAC'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }

View File

@ -12,12 +12,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL);
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
} }
/** /**
@ -27,7 +22,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELI'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','BESSELI'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -43,7 +38,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELJ'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','BESSELJ'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -59,7 +54,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELK'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','BESSELK'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -75,7 +70,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELY'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','BESSELY'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -91,7 +86,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','COMPLEX'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','COMPLEX'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -107,7 +102,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMAGINARY'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMAGINARY'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -123,7 +118,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMREAL'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMREAL'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -139,7 +134,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMABS'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMABS'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -155,7 +150,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMARGUMENT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMARGUMENT'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -171,7 +166,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMCONJUGATE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMCONJUGATE'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -188,7 +183,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMCOS'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMCOS'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -205,7 +200,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMDIV'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMDIV'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -222,7 +217,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMEXP'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMEXP'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -239,7 +234,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLN'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMLN'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -256,7 +251,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLOG2'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMLOG2'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -273,7 +268,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLOG10'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMLOG10'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -290,7 +285,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMPOWER'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMPOWER'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -307,7 +302,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMPRODUCT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMPRODUCT'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -324,7 +319,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSIN'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMSIN'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -341,7 +336,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSQRT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMSQRT'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -358,7 +353,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSUB'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMSUB'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -375,7 +370,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSUM'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','IMSUM'), $args);
$complexAssert = new complexAssert(); $complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
} }
@ -392,7 +387,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','ERF'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','ERF'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -408,7 +403,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','ERFC'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','ERFC'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -424,7 +419,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BINTODEC'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','BINTODEC'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -440,7 +435,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BINTOHEX'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','BINTOHEX'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -456,7 +451,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BINTOOCT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','BINTOOCT'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -472,7 +467,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOBIN'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','DECTOBIN'), $args);
$this->assertEquals($expectedResult, $result, null); $this->assertEquals($expectedResult, $result, null);
} }
@ -488,7 +483,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOHEX'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','DECTOHEX'), $args);
$this->assertEquals($expectedResult, $result, null); $this->assertEquals($expectedResult, $result, null);
} }
@ -504,7 +499,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOOCT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','DECTOOCT'), $args);
$this->assertEquals($expectedResult, $result, null); $this->assertEquals($expectedResult, $result, null);
} }
@ -520,7 +515,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTOBIN'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','HEXTOBIN'), $args);
$this->assertEquals($expectedResult, $result, null); $this->assertEquals($expectedResult, $result, null);
} }
@ -536,7 +531,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTODEC'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','HEXTODEC'), $args);
$this->assertEquals($expectedResult, $result, null); $this->assertEquals($expectedResult, $result, null);
} }
@ -552,7 +547,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTOOCT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','HEXTOOCT'), $args);
$this->assertEquals($expectedResult, $result, null); $this->assertEquals($expectedResult, $result, null);
} }
@ -568,7 +563,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTOBIN'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','OCTTOBIN'), $args);
$this->assertEquals($expectedResult, $result, null); $this->assertEquals($expectedResult, $result, null);
} }
@ -584,7 +579,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTODEC'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','OCTTODEC'), $args);
$this->assertEquals($expectedResult, $result, null); $this->assertEquals($expectedResult, $result, null);
} }
@ -600,7 +595,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTOHEX'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','OCTTOHEX'), $args);
$this->assertEquals($expectedResult, $result, null); $this->assertEquals($expectedResult, $result, null);
} }
@ -616,7 +611,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DELTA'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','DELTA'), $args);
$this->assertEquals($expectedResult, $result, null); $this->assertEquals($expectedResult, $result, null);
} }
@ -632,7 +627,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','GESTEP'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','GESTEP'), $args);
$this->assertEquals($expectedResult, $result, null); $this->assertEquals($expectedResult, $result, null);
} }
@ -643,25 +638,25 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
public function testGetConversionGroups() public function testGetConversionGroups()
{ {
$result = PHPExcel_Calculation_Engineering::getConversionGroups(); $result = \PHPExcel\Calculation\Engineering::getConversionGroups();
$this->assertInternalType('array', $result); $this->assertInternalType('array', $result);
} }
public function testGetConversionGroupUnits() public function testGetConversionGroupUnits()
{ {
$result = PHPExcel_Calculation_Engineering::getConversionGroupUnits(); $result = \PHPExcel\Calculation\Engineering::getConversionGroupUnits();
$this->assertInternalType('array', $result); $this->assertInternalType('array', $result);
} }
public function testGetConversionGroupUnitDetails() public function testGetConversionGroupUnitDetails()
{ {
$result = PHPExcel_Calculation_Engineering::getConversionGroupUnitDetails(); $result = \PHPExcel\Calculation\Engineering::getConversionGroupUnitDetails();
$this->assertInternalType('array', $result); $this->assertInternalType('array', $result);
} }
public function testGetConversionMultipliers() public function testGetConversionMultipliers()
{ {
$result = PHPExcel_Calculation_Engineering::getConversionMultipliers(); $result = \PHPExcel\Calculation\Engineering::getConversionMultipliers();
$this->assertInternalType('array', $result); $this->assertInternalType('array', $result);
} }
@ -672,7 +667,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','CONVERTUOM'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Engineering','CONVERTUOM'), $args);
$this->assertEquals($expectedResult, $result, null); $this->assertEquals($expectedResult, $result, null);
} }

View File

@ -8,12 +8,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL);
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
} }
/** /**
@ -23,7 +18,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ACCRINT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','ACCRINT'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -39,7 +34,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ACCRINTM'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','ACCRINTM'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -55,7 +50,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','AMORDEGRC'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','AMORDEGRC'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -71,7 +66,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','AMORLINC'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','AMORLINC'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -87,7 +82,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYBS'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','COUPDAYBS'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -103,7 +98,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYS'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','COUPDAYS'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -119,7 +114,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYSNC'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','COUPDAYSNC'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -135,7 +130,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPNCD'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','COUPNCD'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -151,7 +146,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPNUM'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','COUPNUM'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -167,7 +162,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPPCD'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','COUPPCD'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -183,7 +178,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','CUMIPMT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','CUMIPMT'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -199,7 +194,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','CUMPRINC'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','CUMPRINC'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -215,7 +210,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DB'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','DB'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -231,7 +226,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DDB'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','DDB'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -247,7 +242,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DISC'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','DISC'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -263,7 +258,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DOLLARDE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','DOLLARDE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -279,7 +274,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DOLLARFR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','DOLLARFR'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -295,7 +290,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','EFFECT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','EFFECT'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -311,7 +306,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','FV'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','FV'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -327,7 +322,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','FVSCHEDULE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','FVSCHEDULE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -343,7 +338,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','INTRATE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','INTRATE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -359,7 +354,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','IPMT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','IPMT'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -375,7 +370,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','IRR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','IRR'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -391,7 +386,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ISPMT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','ISPMT'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -407,7 +402,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','MIRR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','MIRR'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -423,7 +418,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NOMINAL'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','NOMINAL'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -439,7 +434,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NPER'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','NPER'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -455,7 +450,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NPV'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','NPV'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -471,7 +466,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','PRICE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','PRICE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -487,7 +482,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','RATE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','RATE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -503,7 +498,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','XIRR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Financial','XIRR'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }

View File

@ -8,59 +8,54 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL);
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
} }
public function testDUMMY() public function testDUMMY()
{ {
$result = PHPExcel_Calculation_Functions::DUMMY(); $result = \PHPExcel\Calculation\Functions::DUMMY();
$this->assertEquals('#Not Yet Implemented', $result); $this->assertEquals('#Not Yet Implemented', $result);
} }
public function testDIV0() public function testDIV0()
{ {
$result = PHPExcel_Calculation_Functions::DIV0(); $result = \PHPExcel\Calculation\Functions::DIV0();
$this->assertEquals('#DIV/0!', $result); $this->assertEquals('#DIV/0!', $result);
} }
public function testNA() public function testNA()
{ {
$result = PHPExcel_Calculation_Functions::NA(); $result = \PHPExcel\Calculation\Functions::NA();
$this->assertEquals('#N/A', $result); $this->assertEquals('#N/A', $result);
} }
public function testNaN() public function testNaN()
{ {
$result = PHPExcel_Calculation_Functions::NaN(); $result = \PHPExcel\Calculation\Functions::NaN();
$this->assertEquals('#NUM!', $result); $this->assertEquals('#NUM!', $result);
} }
public function testNAME() public function testNAME()
{ {
$result = PHPExcel_Calculation_Functions::NAME(); $result = \PHPExcel\Calculation\Functions::NAME();
$this->assertEquals('#NAME?', $result); $this->assertEquals('#NAME?', $result);
} }
public function testREF() public function testREF()
{ {
$result = PHPExcel_Calculation_Functions::REF(); $result = \PHPExcel\Calculation\Functions::REF();
$this->assertEquals('#REF!', $result); $this->assertEquals('#REF!', $result);
} }
public function testNULL() public function testNULL()
{ {
$result = PHPExcel_Calculation_Functions::null(); $result = \PHPExcel\Calculation\Functions::null();
$this->assertEquals('#NULL!', $result); $this->assertEquals('#NULL!', $result);
} }
public function testVALUE() public function testVALUE()
{ {
$result = PHPExcel_Calculation_Functions::VALUE(); $result = \PHPExcel\Calculation\Functions::VALUE();
$this->assertEquals('#VALUE!', $result); $this->assertEquals('#VALUE!', $result);
} }
@ -71,7 +66,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_BLANK'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','IS_BLANK'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -87,7 +82,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','IS_ERR'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -103,7 +98,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERROR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','IS_ERROR'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -119,7 +114,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','ERROR_TYPE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','ERROR_TYPE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -135,7 +130,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_LOGICAL'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','IS_LOGICAL'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -151,7 +146,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NA'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','IS_NA'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -167,7 +162,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NUMBER'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','IS_NUMBER'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -183,7 +178,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_TEXT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','IS_TEXT'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -199,7 +194,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NONTEXT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','IS_NONTEXT'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -215,7 +210,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_EVEN'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','IS_EVEN'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -231,7 +226,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ODD'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','IS_ODD'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -247,7 +242,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','TYPE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','TYPE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }
@ -263,7 +258,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','N'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Functions','N'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }

View File

@ -8,23 +8,18 @@ class LogicalTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL);
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
} }
public function testTRUE() public function testTRUE()
{ {
$result = PHPExcel_Calculation_Logical::TRUE(); $result = \PHPExcel\Calculation\Logical::TRUE();
$this->assertEquals(true, $result); $this->assertEquals(true, $result);
} }
public function testFALSE() public function testFALSE()
{ {
$result = PHPExcel_Calculation_Logical::FALSE(); $result = \PHPExcel\Calculation\Logical::FALSE();
$this->assertEquals(false, $result); $this->assertEquals(false, $result);
} }
@ -35,7 +30,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_AND'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Logical','LOGICAL_AND'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -51,7 +46,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_OR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Logical','LOGICAL_OR'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -67,7 +62,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','NOT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Logical','NOT'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -83,7 +78,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','STATEMENT_IF'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Logical','STATEMENT_IF'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -99,7 +94,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','IFERROR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\Logical','IFERROR'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }

View File

@ -8,12 +8,7 @@ class LookupRefTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL);
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
} }
/** /**
@ -23,7 +18,7 @@ class LookupRefTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_LookupRef','HLOOKUP'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\LookupRef','HLOOKUP'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -39,7 +34,7 @@ class LookupRefTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_LookupRef','VLOOKUP'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\LookupRef','VLOOKUP'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }

View File

@ -8,12 +8,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL);
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
} }
/** /**
@ -23,7 +18,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ATAN2'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','ATAN2'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -39,7 +34,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','CEILING'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','CEILING'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -55,7 +50,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','COMBIN'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','COMBIN'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -71,7 +66,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','EVEN'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','EVEN'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -87,7 +82,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ODD'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','ODD'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -103,7 +98,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','FACT'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -119,7 +114,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACTDOUBLE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','FACTDOUBLE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -135,7 +130,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FLOOR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','FLOOR'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -151,7 +146,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','GCD'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','GCD'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -167,7 +162,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LCM'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','LCM'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -183,7 +178,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','INT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','INT'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -199,7 +194,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SIGN'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','SIGN'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -215,7 +210,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','POWER'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','POWER'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -231,7 +226,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LOG_BASE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','LOG_BASE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -247,7 +242,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MOD'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','MOD'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -263,7 +258,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MDETERM'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','MDETERM'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -279,7 +274,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MINVERSE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','MINVERSE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -295,7 +290,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MMULT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','MMULT'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -311,7 +306,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MULTINOMIAL'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','MULTINOMIAL'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -327,9 +322,9 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE); \PHPExcel\Calculation::setArrayReturnType(\PHPExcel\Calculation::RETURN_ARRAY_AS_VALUE);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MROUND'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','MROUND'), $args);
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_ARRAY); \PHPExcel\Calculation::setArrayReturnType(\PHPExcel\Calculation::RETURN_ARRAY_AS_ARRAY);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -345,7 +340,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','PRODUCT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','PRODUCT'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -361,7 +356,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','QUOTIENT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','QUOTIENT'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -377,7 +372,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDUP'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','ROUNDUP'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -393,7 +388,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDDOWN'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','ROUNDDOWN'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -409,7 +404,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SERIESSUM'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','SERIESSUM'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -425,7 +420,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SUMSQ'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','SUMSQ'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -441,7 +436,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','TRUNC'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','TRUNC'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -457,7 +452,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROMAN'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','ROMAN'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -473,7 +468,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SQRTPI'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','SQRTPI'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }
@ -489,7 +484,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig', 'SUMIF'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig', 'SUMIF'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-12); $this->assertEquals($expectedResult, $result, null, 1E-12);
} }

View File

@ -8,12 +8,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL);
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
} }
/** /**
@ -23,7 +18,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CHARACTER'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','CHARACTER'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -39,7 +34,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','ASCIICODE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','ASCIICODE'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -55,7 +50,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CONCATENATE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','CONCATENATE'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -71,7 +66,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LEFT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','LEFT'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -87,7 +82,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','MID'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','MID'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -103,7 +98,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RIGHT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','RIGHT'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -119,7 +114,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LOWERCASE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','LOWERCASE'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -135,7 +130,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','UPPERCASE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','UPPERCASE'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -151,7 +146,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','PROPERCASE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','PROPERCASE'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -167,7 +162,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','STRINGLENGTH'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','STRINGLENGTH'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -183,7 +178,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHINSENSITIVE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','SEARCHINSENSITIVE'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -199,7 +194,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHSENSITIVE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','SEARCHSENSITIVE'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -215,7 +210,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','REPLACE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','REPLACE'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -231,7 +226,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SUBSTITUTE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','SUBSTITUTE'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -247,7 +242,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMSPACES'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','TRIMSPACES'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -263,7 +258,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMNONPRINTABLE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','TRIMNONPRINTABLE'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -279,7 +274,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','DOLLAR'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','DOLLAR'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -295,7 +290,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','FIXEDFORMAT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','FIXEDFORMAT'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -311,7 +306,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RETURNSTRING'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData','RETURNSTRING'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -326,13 +321,13 @@ class TextDataTest extends PHPUnit_Framework_TestCase
public function testTEXT() public function testTEXT()
{ {
// Enforce decimal and thousands separator values to UK/US, and currency code to USD // Enforce decimal and thousands separator values to UK/US, and currency code to USD
call_user_func(array('PHPExcel_Shared_String', 'setDecimalSeparator'), '.'); call_user_func(array('\PHPExcel\Shared\String', 'setDecimalSeparator'), '.');
call_user_func(array('PHPExcel_Shared_String', 'setThousandsSeparator'), ','); call_user_func(array('\PHPExcel\Shared\String', 'setThousandsSeparator'), ',');
call_user_func(array('PHPExcel_Shared_String', 'setCurrencyCode'), '$'); call_user_func(array('\PHPExcel\Shared\String', 'setCurrencyCode'), '$');
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData', 'TEXTFORMAT'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData', 'TEXTFORMAT'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -346,13 +341,13 @@ class TextDataTest extends PHPUnit_Framework_TestCase
*/ */
public function testVALUE() public function testVALUE()
{ {
call_user_func(array('PHPExcel_Shared_String', 'setDecimalSeparator'), '.'); call_user_func(array('\PHPExcel\Shared\String', 'setDecimalSeparator'), '.');
call_user_func(array('PHPExcel_Shared_String', 'setThousandsSeparator'), ' '); call_user_func(array('\PHPExcel\Shared\String', 'setThousandsSeparator'), ' ');
call_user_func(array('PHPExcel_Shared_String', 'setCurrencyCode'), '$'); call_user_func(array('\PHPExcel\Shared\String', 'setCurrencyCode'), '$');
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData', 'VALUE'), $args); $result = call_user_func_array(array('\PHPExcel\Calculation\TextData', 'VALUE'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-8); $this->assertEquals($expectedResult, $result, null, 1E-8);
} }

View File

@ -3,15 +3,6 @@
class DataSeriesValuesTest extends PHPUnit_Framework_TestCase class DataSeriesValuesTest extends PHPUnit_Framework_TestCase
{ {
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetDataType() public function testSetDataType()
{ {
$dataTypeValues = array( $dataTypeValues = array(
@ -19,17 +10,17 @@ class DataSeriesValuesTest extends PHPUnit_Framework_TestCase
'String' 'String'
); );
$testInstance = new PHPExcel_Chart_DataSeriesValues; $testInstance = new \PHPExcel\Chart\DataSeriesValues;
foreach ($dataTypeValues as $dataTypeValue) { foreach ($dataTypeValues as $dataTypeValue) {
$result = $testInstance->setDataType($dataTypeValue); $result = $testInstance->setDataType($dataTypeValue);
$this->assertTrue($result instanceof PHPExcel_Chart_DataSeriesValues); $this->assertTrue($result instanceof \PHPExcel\Chart\DataSeriesValues);
} }
} }
public function testSetInvalidDataTypeThrowsException() public function testSetInvalidDataTypeThrowsException()
{ {
$testInstance = new PHPExcel_Chart_DataSeriesValues; $testInstance = new \PHPExcel\Chart\DataSeriesValues;
try { try {
$result = $testInstance->setDataType('BOOLEAN'); $result = $testInstance->setDataType('BOOLEAN');
@ -44,7 +35,7 @@ class DataSeriesValuesTest extends PHPUnit_Framework_TestCase
{ {
$dataTypeValue = 'String'; $dataTypeValue = 'String';
$testInstance = new PHPExcel_Chart_DataSeriesValues; $testInstance = new \PHPExcel\Chart\DataSeriesValues;
$setValue = $testInstance->setDataType($dataTypeValue); $setValue = $testInstance->setDataType($dataTypeValue);
$result = $testInstance->getDataType(); $result = $testInstance->getDataType();

View File

@ -3,30 +3,21 @@
class LayoutTest extends PHPUnit_Framework_TestCase class LayoutTest extends PHPUnit_Framework_TestCase
{ {
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetLayoutTarget() public function testSetLayoutTarget()
{ {
$LayoutTargetValue = 'String'; $LayoutTargetValue = 'String';
$testInstance = new PHPExcel_Chart_Layout; $testInstance = new \PHPExcel\Chart\Layout;
$result = $testInstance->setLayoutTarget($LayoutTargetValue); $result = $testInstance->setLayoutTarget($LayoutTargetValue);
$this->assertTrue($result instanceof PHPExcel_Chart_Layout); $this->assertTrue($result instanceof \PHPExcel\Chart\Layout);
} }
public function testGetLayoutTarget() public function testGetLayoutTarget()
{ {
$LayoutTargetValue = 'String'; $LayoutTargetValue = 'String';
$testInstance = new PHPExcel_Chart_Layout; $testInstance = new \PHPExcel\Chart\Layout;
$setValue = $testInstance->setLayoutTarget($LayoutTargetValue); $setValue = $testInstance->setLayoutTarget($LayoutTargetValue);
$result = $testInstance->getLayoutTarget(); $result = $testInstance->getLayoutTarget();

View File

@ -3,26 +3,17 @@
class LegendTest extends PHPUnit_Framework_TestCase class LegendTest extends PHPUnit_Framework_TestCase
{ {
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetPosition() public function testSetPosition()
{ {
$positionValues = array( $positionValues = array(
PHPExcel_Chart_Legend::POSITION_RIGHT, \PHPExcel\Chart\Legend::POSITION_RIGHT,
PHPExcel_Chart_Legend::POSITION_LEFT, \PHPExcel\Chart\Legend::POSITION_LEFT,
PHPExcel_Chart_Legend::POSITION_TOP, \PHPExcel\Chart\Legend::POSITION_TOP,
PHPExcel_Chart_Legend::POSITION_BOTTOM, \PHPExcel\Chart\Legend::POSITION_BOTTOM,
PHPExcel_Chart_Legend::POSITION_TOPRIGHT, \PHPExcel\Chart\Legend::POSITION_TOPRIGHT,
); );
$testInstance = new PHPExcel_Chart_Legend; $testInstance = new \PHPExcel\Chart\Legend;
foreach ($positionValues as $positionValue) { foreach ($positionValues as $positionValue) {
$result = $testInstance->setPosition($positionValue); $result = $testInstance->setPosition($positionValue);
@ -32,20 +23,20 @@ class LegendTest extends PHPUnit_Framework_TestCase
public function testSetInvalidPositionReturnsFalse() public function testSetInvalidPositionReturnsFalse()
{ {
$testInstance = new PHPExcel_Chart_Legend; $testInstance = new \PHPExcel\Chart\Legend;
$result = $testInstance->setPosition('BottomLeft'); $result = $testInstance->setPosition('BottomLeft');
$this->assertFalse($result); $this->assertFalse($result);
// Ensure that value is unchanged // Ensure that value is unchanged
$result = $testInstance->getPosition(); $result = $testInstance->getPosition();
$this->assertEquals(PHPExcel_Chart_Legend::POSITION_RIGHT, $result); $this->assertEquals(\PHPExcel\Chart\Legend::POSITION_RIGHT, $result);
} }
public function testGetPosition() public function testGetPosition()
{ {
$PositionValue = PHPExcel_Chart_Legend::POSITION_BOTTOM; $PositionValue = \PHPExcel\Chart\Legend::POSITION_BOTTOM;
$testInstance = new PHPExcel_Chart_Legend; $testInstance = new \PHPExcel\Chart\Legend;
$setValue = $testInstance->setPosition($PositionValue); $setValue = $testInstance->setPosition($PositionValue);
$result = $testInstance->getPosition(); $result = $testInstance->getPosition();
@ -55,15 +46,15 @@ class LegendTest extends PHPUnit_Framework_TestCase
public function testSetPositionXL() public function testSetPositionXL()
{ {
$positionValues = array( $positionValues = array(
PHPExcel_Chart_Legend::xlLegendPositionBottom, \PHPExcel\Chart\Legend::xlLegendPositionBottom,
PHPExcel_Chart_Legend::xlLegendPositionCorner, \PHPExcel\Chart\Legend::xlLegendPositionCorner,
PHPExcel_Chart_Legend::xlLegendPositionCustom, \PHPExcel\Chart\Legend::xlLegendPositionCustom,
PHPExcel_Chart_Legend::xlLegendPositionLeft, \PHPExcel\Chart\Legend::xlLegendPositionLeft,
PHPExcel_Chart_Legend::xlLegendPositionRight, \PHPExcel\Chart\Legend::xlLegendPositionRight,
PHPExcel_Chart_Legend::xlLegendPositionTop, \PHPExcel\Chart\Legend::xlLegendPositionTop,
); );
$testInstance = new PHPExcel_Chart_Legend; $testInstance = new \PHPExcel\Chart\Legend;
foreach ($positionValues as $positionValue) { foreach ($positionValues as $positionValue) {
$result = $testInstance->setPositionXL($positionValue); $result = $testInstance->setPositionXL($positionValue);
@ -73,20 +64,20 @@ class LegendTest extends PHPUnit_Framework_TestCase
public function testSetInvalidXLPositionReturnsFalse() public function testSetInvalidXLPositionReturnsFalse()
{ {
$testInstance = new PHPExcel_Chart_Legend; $testInstance = new \PHPExcel\Chart\Legend;
$result = $testInstance->setPositionXL(999); $result = $testInstance->setPositionXL(999);
$this->assertFalse($result); $this->assertFalse($result);
// Ensure that value is unchanged // Ensure that value is unchanged
$result = $testInstance->getPositionXL(); $result = $testInstance->getPositionXL();
$this->assertEquals(PHPExcel_Chart_Legend::xlLegendPositionRight, $result); $this->assertEquals(\PHPExcel\Chart\Legend::xlLegendPositionRight, $result);
} }
public function testGetPositionXL() public function testGetPositionXL()
{ {
$PositionValue = PHPExcel_Chart_Legend::xlLegendPositionCorner; $PositionValue = \PHPExcel\Chart\Legend::xlLegendPositionCorner;
$testInstance = new PHPExcel_Chart_Legend; $testInstance = new \PHPExcel\Chart\Legend;
$setValue = $testInstance->setPositionXL($PositionValue); $setValue = $testInstance->setPositionXL($PositionValue);
$result = $testInstance->getPositionXL(); $result = $testInstance->getPositionXL();
@ -100,7 +91,7 @@ class LegendTest extends PHPUnit_Framework_TestCase
false, false,
); );
$testInstance = new PHPExcel_Chart_Legend; $testInstance = new \PHPExcel\Chart\Legend;
foreach ($overlayValues as $overlayValue) { foreach ($overlayValues as $overlayValue) {
$result = $testInstance->setOverlay($overlayValue); $result = $testInstance->setOverlay($overlayValue);
@ -110,7 +101,7 @@ class LegendTest extends PHPUnit_Framework_TestCase
public function testSetInvalidOverlayReturnsFalse() public function testSetInvalidOverlayReturnsFalse()
{ {
$testInstance = new PHPExcel_Chart_Legend; $testInstance = new \PHPExcel\Chart\Legend;
$result = $testInstance->setOverlay('INVALID'); $result = $testInstance->setOverlay('INVALID');
$this->assertFalse($result); $this->assertFalse($result);
@ -123,7 +114,7 @@ class LegendTest extends PHPUnit_Framework_TestCase
{ {
$OverlayValue = true; $OverlayValue = true;
$testInstance = new PHPExcel_Chart_Legend; $testInstance = new \PHPExcel\Chart\Legend;
$setValue = $testInstance->setOverlay($OverlayValue); $setValue = $testInstance->setOverlay($OverlayValue);
$result = $testInstance->getOverlay(); $result = $testInstance->getOverlay();

View File

@ -3,15 +3,6 @@
class XEEValidatorTest extends PHPUnit_Framework_TestCase class XEEValidatorTest extends PHPUnit_Framework_TestCase
{ {
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* @dataProvider providerInvalidXML * @dataProvider providerInvalidXML
* @expectedException PHPExcel_Reader_Exception * @expectedException PHPExcel_Reader_Exception

View File

@ -5,15 +5,6 @@ require_once 'testDataFileIterator.php';
class CodePageTest extends PHPUnit_Framework_TestCase class CodePageTest extends PHPUnit_Framework_TestCase
{ {
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* @dataProvider providerCodePage * @dataProvider providerCodePage
*/ */

View File

@ -5,24 +5,15 @@ require_once 'testDataFileIterator.php';
class DateTest extends PHPUnit_Framework_TestCase class DateTest extends PHPUnit_Framework_TestCase
{ {
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetExcelCalendar() public function testSetExcelCalendar()
{ {
$calendarValues = array( $calendarValues = array(
PHPExcel_Shared_Date::CALENDAR_MAC_1904, \PHPExcel\Shared\Date::CALENDAR_MAC_1904,
PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900, \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900,
); );
foreach ($calendarValues as $calendarValue) { foreach ($calendarValues as $calendarValue) {
$result = call_user_func(array('PHPExcel_Shared_Date','setExcelCalendar'), $calendarValue); $result = call_user_func(array('\PHPExcel\Shared\Date','setExcelCalendar'), $calendarValue);
$this->assertTrue($result); $this->assertTrue($result);
} }
} }
@ -30,7 +21,7 @@ class DateTest extends PHPUnit_Framework_TestCase
public function testSetExcelCalendarWithInvalidValue() public function testSetExcelCalendarWithInvalidValue()
{ {
$unsupportedCalendar = '2012'; $unsupportedCalendar = '2012';
$result = call_user_func(array('PHPExcel_Shared_Date','setExcelCalendar'), $unsupportedCalendar); $result = call_user_func(array('\PHPExcel\Shared\Date','setExcelCalendar'), $unsupportedCalendar);
$this->assertFalse($result); $this->assertFalse($result);
} }
@ -40,8 +31,8 @@ class DateTest extends PHPUnit_Framework_TestCase
public function testDateTimeExcelToPHP1900() public function testDateTimeExcelToPHP1900()
{ {
$result = call_user_func( $result = call_user_func(
array('PHPExcel_Shared_Date','setExcelCalendar'), array('\PHPExcel\Shared\Date','setExcelCalendar'),
PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900 \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900
); );
$args = func_get_args(); $args = func_get_args();
@ -49,7 +40,7 @@ class DateTest extends PHPUnit_Framework_TestCase
if ($args[0] < 1) { if ($args[0] < 1) {
$expectedResult += gmmktime(0, 0, 0); $expectedResult += gmmktime(0, 0, 0);
} }
$result = call_user_func_array(array('PHPExcel_Shared_Date', 'ExcelToPHP'), $args); $result = call_user_func_array(array('\PHPExcel\Shared\Date', 'ExcelToPHP'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -64,13 +55,13 @@ class DateTest extends PHPUnit_Framework_TestCase
public function testDateTimePHPToExcel1900() public function testDateTimePHPToExcel1900()
{ {
$result = call_user_func( $result = call_user_func(
array('PHPExcel_Shared_Date','setExcelCalendar'), array('\PHPExcel\Shared\Date','setExcelCalendar'),
PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900 \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900
); );
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Date','PHPToExcel'), $args); $result = call_user_func_array(array('\PHPExcel\Shared\Date','PHPToExcel'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-5); $this->assertEquals($expectedResult, $result, null, 1E-5);
} }
@ -85,13 +76,13 @@ class DateTest extends PHPUnit_Framework_TestCase
public function testDateTimeFormattedPHPToExcel1900() public function testDateTimeFormattedPHPToExcel1900()
{ {
$result = call_user_func( $result = call_user_func(
array('PHPExcel_Shared_Date','setExcelCalendar'), array('\PHPExcel\Shared\Date','setExcelCalendar'),
PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900 \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900
); );
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Date','FormattedPHPToExcel'), $args); $result = call_user_func_array(array('\PHPExcel\Shared\Date','FormattedPHPToExcel'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-5); $this->assertEquals($expectedResult, $result, null, 1E-5);
} }
@ -106,8 +97,8 @@ class DateTest extends PHPUnit_Framework_TestCase
public function testDateTimeExcelToPHP1904() public function testDateTimeExcelToPHP1904()
{ {
$result = call_user_func( $result = call_user_func(
array('PHPExcel_Shared_Date','setExcelCalendar'), array('\PHPExcel\Shared\Date','setExcelCalendar'),
PHPExcel_Shared_Date::CALENDAR_MAC_1904 \PHPExcel\Shared\Date::CALENDAR_MAC_1904
); );
$args = func_get_args(); $args = func_get_args();
@ -115,7 +106,7 @@ class DateTest extends PHPUnit_Framework_TestCase
if ($args[0] < 1) { if ($args[0] < 1) {
$expectedResult += gmmktime(0, 0, 0); $expectedResult += gmmktime(0, 0, 0);
} }
$result = call_user_func_array(array('PHPExcel_Shared_Date','ExcelToPHP'), $args); $result = call_user_func_array(array('\PHPExcel\Shared\Date','ExcelToPHP'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -130,13 +121,13 @@ class DateTest extends PHPUnit_Framework_TestCase
public function testDateTimePHPToExcel1904() public function testDateTimePHPToExcel1904()
{ {
$result = call_user_func( $result = call_user_func(
array('PHPExcel_Shared_Date','setExcelCalendar'), array('\PHPExcel\Shared\Date','setExcelCalendar'),
PHPExcel_Shared_Date::CALENDAR_MAC_1904 \PHPExcel\Shared\Date::CALENDAR_MAC_1904
); );
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Date','PHPToExcel'), $args); $result = call_user_func_array(array('\PHPExcel\Shared\Date','PHPToExcel'), $args);
$this->assertEquals($expectedResult, $result, null, 1E-5); $this->assertEquals($expectedResult, $result, null, 1E-5);
} }
@ -152,7 +143,7 @@ class DateTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Date','isDateTimeFormatCode'), $args); $result = call_user_func_array(array('\PHPExcel\Shared\Date','isDateTimeFormatCode'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -167,8 +158,8 @@ class DateTest extends PHPUnit_Framework_TestCase
public function testDateTimeExcelToPHP1900Timezone() public function testDateTimeExcelToPHP1900Timezone()
{ {
$result = call_user_func( $result = call_user_func(
array('PHPExcel_Shared_Date','setExcelCalendar'), array('\PHPExcel\Shared\Date','setExcelCalendar'),
PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900 \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900
); );
$args = func_get_args(); $args = func_get_args();
@ -176,7 +167,7 @@ class DateTest extends PHPUnit_Framework_TestCase
if ($args[0] < 1) { if ($args[0] < 1) {
$expectedResult += gmmktime(0, 0, 0); $expectedResult += gmmktime(0, 0, 0);
} }
$result = call_user_func_array(array('PHPExcel_Shared_Date','ExcelToPHP'), $args); $result = call_user_func_array(array('\PHPExcel\Shared\Date','ExcelToPHP'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }

View File

@ -5,15 +5,6 @@ require_once 'testDataFileIterator.php';
class FileTest extends PHPUnit_Framework_TestCase class FileTest extends PHPUnit_Framework_TestCase
{ {
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testGetUseUploadTempDirectory() public function testGetUseUploadTempDirectory()
{ {
$expectedResult = false; $expectedResult = false;

View File

@ -5,32 +5,23 @@ require_once 'testDataFileIterator.php';
class FontTest extends PHPUnit_Framework_TestCase class FontTest extends PHPUnit_Framework_TestCase
{ {
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testGetAutoSizeMethod() public function testGetAutoSizeMethod()
{ {
$expectedResult = PHPExcel_Shared_Font::AUTOSIZE_METHOD_APPROX; $expectedResult = \PHPExcel\Shared\Font::AUTOSIZE_METHOD_APPROX;
$result = call_user_func(array('PHPExcel_Shared_Font','getAutoSizeMethod')); $result = call_user_func(array('\PHPExcel\Shared\Font','getAutoSizeMethod'));
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
public function testSetAutoSizeMethod() public function testSetAutoSizeMethod()
{ {
$autosizeMethodValues = array( $autosizeMethodValues = array(
PHPExcel_Shared_Font::AUTOSIZE_METHOD_EXACT, \PHPExcel\Shared\Font::AUTOSIZE_METHOD_EXACT,
PHPExcel_Shared_Font::AUTOSIZE_METHOD_APPROX, \PHPExcel\Shared\Font::AUTOSIZE_METHOD_APPROX,
); );
foreach ($autosizeMethodValues as $autosizeMethodValue) { foreach ($autosizeMethodValues as $autosizeMethodValue) {
$result = call_user_func(array('PHPExcel_Shared_Font','setAutoSizeMethod'), $autosizeMethodValue); $result = call_user_func(array('\PHPExcel\Shared\Font','setAutoSizeMethod'), $autosizeMethodValue);
$this->assertTrue($result); $this->assertTrue($result);
} }
} }
@ -39,7 +30,7 @@ class FontTest extends PHPUnit_Framework_TestCase
{ {
$unsupportedAutosizeMethod = 'guess'; $unsupportedAutosizeMethod = 'guess';
$result = call_user_func(array('PHPExcel_Shared_Font','setAutoSizeMethod'), $unsupportedAutosizeMethod); $result = call_user_func(array('\PHPExcel\Shared\Font','setAutoSizeMethod'), $unsupportedAutosizeMethod);
$this->assertFalse($result); $this->assertFalse($result);
} }
@ -50,7 +41,7 @@ class FontTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Font','fontSizeToPixels'), $args); $result = call_user_func_array(array('\PHPExcel\Shared\Font','fontSizeToPixels'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -66,7 +57,7 @@ class FontTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Font','inchSizeToPixels'), $args); $result = call_user_func_array(array('\PHPExcel\Shared\Font','inchSizeToPixels'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -82,7 +73,7 @@ class FontTest extends PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Font','centimeterSizeToPixels'), $args); $result = call_user_func_array(array('\PHPExcel\Shared\Font','centimeterSizeToPixels'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }

View File

@ -5,15 +5,6 @@ require_once 'testDataFileIterator.php';
class PasswordHasherTest extends PHPUnit_Framework_TestCase class PasswordHasherTest extends PHPUnit_Framework_TestCase
{ {
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* @dataProvider providerHashPassword * @dataProvider providerHashPassword
*/ */

View File

@ -5,24 +5,15 @@ require_once 'testDataFileIterator.php';
class StringTest extends PHPUnit_Framework_TestCase class StringTest extends PHPUnit_Framework_TestCase
{ {
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testGetIsMbStringEnabled() public function testGetIsMbStringEnabled()
{ {
$result = call_user_func(array('PHPExcel_Shared_String','getIsMbstringEnabled')); $result = call_user_func(array('\PHPExcel\Shared\String','getIsMbstringEnabled'));
$this->assertTrue($result); $this->assertTrue($result);
} }
public function testGetIsIconvEnabled() public function testGetIsIconvEnabled()
{ {
$result = call_user_func(array('PHPExcel_Shared_String','getIsIconvEnabled')); $result = call_user_func(array('\PHPExcel\Shared\String','getIsIconvEnabled'));
$this->assertTrue($result); $this->assertTrue($result);
} }
@ -31,16 +22,16 @@ class StringTest extends PHPUnit_Framework_TestCase
$localeconv = localeconv(); $localeconv = localeconv();
$expectedResult = (!empty($localeconv['decimal_point'])) ? $localeconv['decimal_point'] : ','; $expectedResult = (!empty($localeconv['decimal_point'])) ? $localeconv['decimal_point'] : ',';
$result = call_user_func(array('PHPExcel_Shared_String','getDecimalSeparator')); $result = call_user_func(array('\PHPExcel\Shared\String','getDecimalSeparator'));
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
public function testSetDecimalSeparator() public function testSetDecimalSeparator()
{ {
$expectedResult = ','; $expectedResult = ',';
$result = call_user_func(array('PHPExcel_Shared_String','setDecimalSeparator'), $expectedResult); $result = call_user_func(array('\PHPExcel\Shared\String','setDecimalSeparator'), $expectedResult);
$result = call_user_func(array('PHPExcel_Shared_String','getDecimalSeparator')); $result = call_user_func(array('\PHPExcel\Shared\String','getDecimalSeparator'));
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -49,16 +40,16 @@ class StringTest extends PHPUnit_Framework_TestCase
$localeconv = localeconv(); $localeconv = localeconv();
$expectedResult = (!empty($localeconv['thousands_sep'])) ? $localeconv['thousands_sep'] : ','; $expectedResult = (!empty($localeconv['thousands_sep'])) ? $localeconv['thousands_sep'] : ',';
$result = call_user_func(array('PHPExcel_Shared_String','getThousandsSeparator')); $result = call_user_func(array('\PHPExcel\Shared\String','getThousandsSeparator'));
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
public function testSetThousandsSeparator() public function testSetThousandsSeparator()
{ {
$expectedResult = ' '; $expectedResult = ' ';
$result = call_user_func(array('PHPExcel_Shared_String','setThousandsSeparator'), $expectedResult); $result = call_user_func(array('\PHPExcel\Shared\String','setThousandsSeparator'), $expectedResult);
$result = call_user_func(array('PHPExcel_Shared_String','getThousandsSeparator')); $result = call_user_func(array('\PHPExcel\Shared\String','getThousandsSeparator'));
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -67,16 +58,16 @@ class StringTest extends PHPUnit_Framework_TestCase
$localeconv = localeconv(); $localeconv = localeconv();
$expectedResult = (!empty($localeconv['currency_symbol'])) ? $localeconv['currency_symbol'] : '$'; $expectedResult = (!empty($localeconv['currency_symbol'])) ? $localeconv['currency_symbol'] : '$';
$result = call_user_func(array('PHPExcel_Shared_String','getCurrencyCode')); $result = call_user_func(array('\PHPExcel\Shared\String','getCurrencyCode'));
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
public function testSetCurrencyCode() public function testSetCurrencyCode()
{ {
$expectedResult = '£'; $expectedResult = '£';
$result = call_user_func(array('PHPExcel_Shared_String','setCurrencyCode'), $expectedResult); $result = call_user_func(array('\PHPExcel\Shared\String','setCurrencyCode'), $expectedResult);
$result = call_user_func(array('PHPExcel_Shared_String','getCurrencyCode')); $result = call_user_func(array('\PHPExcel\Shared\String','getCurrencyCode'));
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
} }

View File

@ -3,15 +3,6 @@
class TimeZoneTest extends PHPUnit_Framework_TestCase class TimeZoneTest extends PHPUnit_Framework_TestCase
{ {
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetTimezone() public function testSetTimezone()
{ {
$timezoneValues = array( $timezoneValues = array(
@ -23,7 +14,7 @@ class TimeZoneTest extends PHPUnit_Framework_TestCase
); );
foreach ($timezoneValues as $timezoneValue) { foreach ($timezoneValues as $timezoneValue) {
$result = call_user_func(array('PHPExcel_Shared_TimeZone','setTimezone'), $timezoneValue); $result = call_user_func(array('\PHPExcel\Shared\TimeZone','setTimezone'), $timezoneValue);
$this->assertTrue($result); $this->assertTrue($result);
} }
@ -32,7 +23,7 @@ class TimeZoneTest extends PHPUnit_Framework_TestCase
public function testSetTimezoneWithInvalidValue() public function testSetTimezoneWithInvalidValue()
{ {
$unsupportedTimezone = 'Etc/GMT+10'; $unsupportedTimezone = 'Etc/GMT+10';
$result = call_user_func(array('PHPExcel_Shared_TimeZone','setTimezone'), $unsupportedTimezone); $result = call_user_func(array('\PHPExcel\Shared\TimeZone','setTimezone'), $unsupportedTimezone);
$this->assertFalse($result); $this->assertFalse($result);
} }
} }

View File

@ -5,15 +5,6 @@ require_once 'testDataFileIteratorJson.php';
class ColorTest extends PHPUnit_Framework_TestCase class ColorTest extends PHPUnit_Framework_TestCase
{ {
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . '/Bootstrap.php');
}
/** /**
* @dataProvider providerColorGetRed * @dataProvider providerColorGetRed
*/ */

View File

@ -8,13 +8,8 @@ class NumberFormatDateTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { \PHPExcel\Shared\String::setDecimalSeparator('.');
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); \PHPExcel\Shared\String::setThousandsSeparator(',');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Shared_String::setDecimalSeparator('.');
PHPExcel_Shared_String::setThousandsSeparator(',');
} }
/** /**

View File

@ -8,13 +8,8 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { \PHPExcel\Shared\String::setDecimalSeparator('.');
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); \PHPExcel\Shared\String::setThousandsSeparator(',');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Shared_String::setDecimalSeparator('.');
PHPExcel_Shared_String::setThousandsSeparator(',');
} }
/** /**

View File

@ -9,12 +9,7 @@ class RuleTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { $this->_mockAutoFilterColumnObject = $this->getMockBuilder('\PHPExcel\Worksheet\AutoFilter\Column')
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->_mockAutoFilterColumnObject = $this->getMockBuilder('PHPExcel_Worksheet_AutoFilter_Column')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -22,7 +17,7 @@ class RuleTest extends PHPUnit_Framework_TestCase
->method('testColumnInRange') ->method('testColumnInRange')
->will($this->returnValue(3)); ->will($this->returnValue(3));
$this->_testAutoFilterRuleObject = new PHPExcel_Worksheet_AutoFilter_Column_Rule( $this->_testAutoFilterRuleObject = new \PHPExcel\Worksheet\AutoFilter\Column\Rule(
$this->_mockAutoFilterColumnObject $this->_mockAutoFilterColumnObject
); );
} }
@ -30,16 +25,16 @@ class RuleTest extends PHPUnit_Framework_TestCase
public function testGetRuleType() public function testGetRuleType()
{ {
$result = $this->_testAutoFilterRuleObject->getRuleType(); $result = $this->_testAutoFilterRuleObject->getRuleType();
$this->assertEquals(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER, $result); $this->assertEquals(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER, $result);
} }
public function testSetRuleType() public function testSetRuleType()
{ {
$expectedResult = PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP; $expectedResult = \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP;
// Setters return the instance to implement the fluent interface // Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterRuleObject->setRuleType($expectedResult); $result = $this->_testAutoFilterRuleObject->setRuleType($expectedResult);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column\Rule', $result);
$result = $this->_testAutoFilterRuleObject->getRuleType(); $result = $this->_testAutoFilterRuleObject->getRuleType();
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
@ -51,7 +46,7 @@ class RuleTest extends PHPUnit_Framework_TestCase
// Setters return the instance to implement the fluent interface // Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterRuleObject->setValue($expectedResult); $result = $this->_testAutoFilterRuleObject->setValue($expectedResult);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column\Rule', $result);
$result = $this->_testAutoFilterRuleObject->getValue(); $result = $this->_testAutoFilterRuleObject->getValue();
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
@ -60,16 +55,16 @@ class RuleTest extends PHPUnit_Framework_TestCase
public function testGetOperator() public function testGetOperator()
{ {
$result = $this->_testAutoFilterRuleObject->getOperator(); $result = $this->_testAutoFilterRuleObject->getOperator();
$this->assertEquals(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL, $result); $this->assertEquals(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, $result);
} }
public function testSetOperator() public function testSetOperator()
{ {
$expectedResult = PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN; $expectedResult = \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN;
// Setters return the instance to implement the fluent interface // Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterRuleObject->setOperator($expectedResult); $result = $this->_testAutoFilterRuleObject->setOperator($expectedResult);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column\Rule', $result);
$result = $this->_testAutoFilterRuleObject->getOperator(); $result = $this->_testAutoFilterRuleObject->getOperator();
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
@ -77,11 +72,11 @@ class RuleTest extends PHPUnit_Framework_TestCase
public function testSetGrouping() public function testSetGrouping()
{ {
$expectedResult = PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH; $expectedResult = \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH;
// Setters return the instance to implement the fluent interface // Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterRuleObject->setGrouping($expectedResult); $result = $this->_testAutoFilterRuleObject->setGrouping($expectedResult);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column\Rule', $result);
$result = $this->_testAutoFilterRuleObject->getGrouping(); $result = $this->_testAutoFilterRuleObject->getGrouping();
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
@ -90,19 +85,19 @@ class RuleTest extends PHPUnit_Framework_TestCase
public function testGetParent() public function testGetParent()
{ {
$result = $this->_testAutoFilterRuleObject->getParent(); $result = $this->_testAutoFilterRuleObject->getParent();
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result);
} }
public function testSetParent() public function testSetParent()
{ {
// Setters return the instance to implement the fluent interface // Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterRuleObject->setParent($this->_mockAutoFilterColumnObject); $result = $this->_testAutoFilterRuleObject->setParent($this->_mockAutoFilterColumnObject);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column\Rule', $result);
} }
public function testClone() public function testClone()
{ {
$result = clone $this->_testAutoFilterRuleObject; $result = clone $this->_testAutoFilterRuleObject;
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column\Rule', $result);
} }
} }

View File

@ -11,12 +11,7 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { $this->_mockAutoFilterObject = $this->getMockBuilder('\PHPExcel\Worksheet\AutoFilter')
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->_mockAutoFilterObject = $this->getMockBuilder('PHPExcel_Worksheet_AutoFilter')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -24,7 +19,7 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase
->method('testColumnInRange') ->method('testColumnInRange')
->will($this->returnValue(3)); ->will($this->returnValue(3));
$this->_testAutoFilterColumnObject = new PHPExcel_Worksheet_AutoFilter_Column( $this->_testAutoFilterColumnObject = new \PHPExcel\Worksheet\AutoFilter\Column(
$this->_testInitialColumn, $this->_testInitialColumn,
$this->_mockAutoFilterObject $this->_mockAutoFilterObject
); );
@ -42,7 +37,7 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase
// Setters return the instance to implement the fluent interface // Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterColumnObject->setColumnIndex($expectedResult); $result = $this->_testAutoFilterColumnObject->setColumnIndex($expectedResult);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result);
$result = $this->_testAutoFilterColumnObject->getColumnIndex(); $result = $this->_testAutoFilterColumnObject->getColumnIndex();
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
@ -51,29 +46,29 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase
public function testGetParent() public function testGetParent()
{ {
$result = $this->_testAutoFilterColumnObject->getParent(); $result = $this->_testAutoFilterColumnObject->getParent();
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter', $result);
} }
public function testSetParent() public function testSetParent()
{ {
// Setters return the instance to implement the fluent interface // Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterColumnObject->setParent($this->_mockAutoFilterObject); $result = $this->_testAutoFilterColumnObject->setParent($this->_mockAutoFilterObject);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result);
} }
public function testGetFilterType() public function testGetFilterType()
{ {
$result = $this->_testAutoFilterColumnObject->getFilterType(); $result = $this->_testAutoFilterColumnObject->getFilterType();
$this->assertEquals(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER, $result); $this->assertEquals(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER, $result);
} }
public function testSetFilterType() public function testSetFilterType()
{ {
$result = $this->_testAutoFilterColumnObject->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); $result = $this->_testAutoFilterColumnObject->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result);
$result = $this->_testAutoFilterColumnObject->getFilterType(); $result = $this->_testAutoFilterColumnObject->getFilterType();
$this->assertEquals(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER, $result); $this->assertEquals(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER, $result);
} }
/** /**
@ -89,16 +84,16 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase
public function testGetJoin() public function testGetJoin()
{ {
$result = $this->_testAutoFilterColumnObject->getJoin(); $result = $this->_testAutoFilterColumnObject->getJoin();
$this->assertEquals(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR, $result); $this->assertEquals(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_OR, $result);
} }
public function testSetJoin() public function testSetJoin()
{ {
$result = $this->_testAutoFilterColumnObject->setJoin(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND); $result = $this->_testAutoFilterColumnObject->setJoin(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result);
$result = $this->_testAutoFilterColumnObject->getJoin(); $result = $this->_testAutoFilterColumnObject->getJoin();
$this->assertEquals(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND, $result); $this->assertEquals(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND, $result);
} }
/** /**
@ -119,7 +114,7 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase
// Setters return the instance to implement the fluent interface // Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterColumnObject->setAttributes($attributeSet); $result = $this->_testAutoFilterColumnObject->setAttributes($attributeSet);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result);
} }
public function testGetAttributes() public function testGetAttributes()
@ -144,7 +139,7 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase
foreach ($attributeSet as $attributeName => $attributeValue) { foreach ($attributeSet as $attributeName => $attributeValue) {
// Setters return the instance to implement the fluent interface // Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterColumnObject->setAttribute($attributeName, $attributeValue); $result = $this->_testAutoFilterColumnObject->setAttribute($attributeName, $attributeValue);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result);
} }
} }
@ -167,6 +162,6 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase
public function testClone() public function testClone()
{ {
$result = clone $this->_testAutoFilterColumnObject; $result = clone $this->_testAutoFilterColumnObject;
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result);
} }
} }

View File

@ -14,7 +14,7 @@ class CellCollectionTest extends \PHPUnit_Framework_TestCase
$methods = \PHPExcel\CachedObjectStorageFactory::getCacheStorageMethods(); $methods = \PHPExcel\CachedObjectStorageFactory::getCacheStorageMethods();
foreach ($methods as $method) { foreach ($methods as $method) {
\PHPExcel\CachedObjectStorageFactory::initialize($method); \PHPExcel\CachedObjectStorageFactory::initialize($method);
$workbook = new \PHPExcel(); $workbook = new \PHPExcel\Spreadsheet();
$cells = ['A1', 'A2']; $cells = ['A1', 'A2'];
$worksheet = $workbook->getActiveSheet(); $worksheet = $workbook->getActiveSheet();
$worksheet->setCellValue('A1', 1); $worksheet->setCellValue('A1', 1);

View File

@ -7,16 +7,11 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->mockCell = $this->getMockBuilder('PHPExcel_Cell') $this->mockCell = $this->getMockBuilder('PHPExcel_Cell')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet') $this->mockWorksheet = $this->getMockBuilder('\PHPExcel\Worksheet')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -31,7 +26,7 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase
public function testIteratorFullRange() public function testIteratorFullRange()
{ {
$iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet); $iterator = new \PHPExcel\Worksheet\RowCellIterator($this->mockWorksheet);
$RowCellIndexResult = 'A'; $RowCellIndexResult = 'A';
$this->assertEquals($RowCellIndexResult, $iterator->key()); $this->assertEquals($RowCellIndexResult, $iterator->key());
@ -43,7 +38,7 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase
public function testIteratorStartEndRange() public function testIteratorStartEndRange()
{ {
$iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet, 2, 'B', 'D'); $iterator = new \PHPExcel\Worksheet\RowCellIterator($this->mockWorksheet, 2, 'B', 'D');
$RowCellIndexResult = 'B'; $RowCellIndexResult = 'B';
$this->assertEquals($RowCellIndexResult, $iterator->key()); $this->assertEquals($RowCellIndexResult, $iterator->key());
@ -56,7 +51,7 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase
public function testIteratorSeekAndPrev() public function testIteratorSeekAndPrev()
{ {
$ranges = range('A', 'E'); $ranges = range('A', 'E');
$iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet, 2, 'B', 'D'); $iterator = new \PHPExcel\Worksheet\RowCellIterator($this->mockWorksheet, 2, 'B', 'D');
$RowCellIndexResult = 'D'; $RowCellIndexResult = 'D';
$iterator->seek('D'); $iterator->seek('D');
$this->assertEquals($RowCellIndexResult, $iterator->key()); $this->assertEquals($RowCellIndexResult, $iterator->key());
@ -73,7 +68,7 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase
*/ */
public function testSeekOutOfRange() public function testSeekOutOfRange()
{ {
$iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet, 2, 'B', 'D'); $iterator = new \PHPExcel\Worksheet\RowCellIterator($this->mockWorksheet, 2, 'B', 'D');
$iterator->seek(1); $iterator->seek(1);
} }
@ -82,7 +77,7 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase
*/ */
public function testPrevOutOfRange() public function testPrevOutOfRange()
{ {
$iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet, 2, 'B', 'D'); $iterator = new \PHPExcel\Worksheet\RowCellIterator($this->mockWorksheet, 2, 'B', 'D');
$iterator->prev(); $iterator->prev();
} }
} }

View File

@ -7,16 +7,11 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { $this->mockRow = $this->getMockBuilder('\PHPExcel\Worksheet\Row')
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->mockRow = $this->getMockBuilder('PHPExcel_Worksheet_Row')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet') $this->mockWorksheet = $this->getMockBuilder('\PHPExcel\Worksheet')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -31,31 +26,31 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase
public function testIteratorFullRange() public function testIteratorFullRange()
{ {
$iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet); $iterator = new \PHPExcel\Worksheet\RowIterator($this->mockWorksheet);
$rowIndexResult = 1; $rowIndexResult = 1;
$this->assertEquals($rowIndexResult, $iterator->key()); $this->assertEquals($rowIndexResult, $iterator->key());
foreach ($iterator as $key => $row) { foreach ($iterator as $key => $row) {
$this->assertEquals($rowIndexResult++, $key); $this->assertEquals($rowIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Worksheet_Row', $row); $this->assertInstanceOf('\PHPExcel\Worksheet\Row', $row);
} }
} }
public function testIteratorStartEndRange() public function testIteratorStartEndRange()
{ {
$iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4); $iterator = new \PHPExcel\Worksheet\RowIterator($this->mockWorksheet, 2, 4);
$rowIndexResult = 2; $rowIndexResult = 2;
$this->assertEquals($rowIndexResult, $iterator->key()); $this->assertEquals($rowIndexResult, $iterator->key());
foreach ($iterator as $key => $row) { foreach ($iterator as $key => $row) {
$this->assertEquals($rowIndexResult++, $key); $this->assertEquals($rowIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Worksheet_Row', $row); $this->assertInstanceOf('\PHPExcel\Worksheet\Row', $row);
} }
} }
public function testIteratorSeekAndPrev() public function testIteratorSeekAndPrev()
{ {
$iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4); $iterator = new \PHPExcel\Worksheet\RowIterator($this->mockWorksheet, 2, 4);
$columnIndexResult = 4; $columnIndexResult = 4;
$iterator->seek(4); $iterator->seek(4);
$this->assertEquals($columnIndexResult, $iterator->key()); $this->assertEquals($columnIndexResult, $iterator->key());
@ -71,7 +66,7 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase
*/ */
public function testSeekOutOfRange() public function testSeekOutOfRange()
{ {
$iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4); $iterator = new \PHPExcel\Worksheet\RowIterator($this->mockWorksheet, 2, 4);
$iterator->seek(1); $iterator->seek(1);
} }
@ -80,7 +75,7 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase
*/ */
public function testPrevOutOfRange() public function testPrevOutOfRange()
{ {
$iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4); $iterator = new \PHPExcel\Worksheet\RowIterator($this->mockWorksheet, 2, 4);
$iterator->prev(); $iterator->prev();
} }
} }

View File

@ -7,12 +7,7 @@ class WorksheetColumnTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { $this->mockWorksheet = $this->getMockBuilder('\PHPExcel\Worksheet')
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$this->mockWorksheet->expects($this->any()) $this->mockWorksheet->expects($this->any())
@ -23,24 +18,24 @@ class WorksheetColumnTest extends PHPUnit_Framework_TestCase
public function testInstantiateColumnDefault() public function testInstantiateColumnDefault()
{ {
$column = new PHPExcel_Worksheet_Column($this->mockWorksheet); $column = new \PHPExcel\Worksheet\Column($this->mockWorksheet);
$this->assertInstanceOf('PHPExcel_Worksheet_Column', $column); $this->assertInstanceOf('\PHPExcel\Worksheet\Column', $column);
$columnIndex = $column->getColumnIndex(); $columnIndex = $column->getColumnIndex();
$this->assertEquals('A', $columnIndex); $this->assertEquals('A', $columnIndex);
} }
public function testInstantiateColumnSpecified() public function testInstantiateColumnSpecified()
{ {
$column = new PHPExcel_Worksheet_Column($this->mockWorksheet, 'E'); $column = new \PHPExcel\Worksheet\Column($this->mockWorksheet, 'E');
$this->assertInstanceOf('PHPExcel_Worksheet_Column', $column); $this->assertInstanceOf('\PHPExcel\Worksheet\Column', $column);
$columnIndex = $column->getColumnIndex(); $columnIndex = $column->getColumnIndex();
$this->assertEquals('E', $columnIndex); $this->assertEquals('E', $columnIndex);
} }
public function testGetCellIterator() public function testGetCellIterator()
{ {
$column = new PHPExcel_Worksheet_Column($this->mockWorksheet); $column = new \PHPExcel\Worksheet\Column($this->mockWorksheet);
$cellIterator = $column->getCellIterator(); $cellIterator = $column->getCellIterator();
$this->assertInstanceOf('PHPExcel_Worksheet_ColumnCellIterator', $cellIterator); $this->assertInstanceOf('\PHPExcel\Worksheet\ColumnCellIterator', $cellIterator);
} }
} }

View File

@ -7,12 +7,7 @@ class WorksheetRowTest extends PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (!defined('PHPEXCEL_ROOT')) { $this->mockWorksheet = $this->getMockBuilder('\PHPExcel\Worksheet')
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$this->mockWorksheet->expects($this->any()) $this->mockWorksheet->expects($this->any())
@ -23,24 +18,24 @@ class WorksheetRowTest extends PHPUnit_Framework_TestCase
public function testInstantiateRowDefault() public function testInstantiateRowDefault()
{ {
$row = new PHPExcel_Worksheet_Row($this->mockWorksheet); $row = new \PHPExcel\Worksheet\Row($this->mockWorksheet);
$this->assertInstanceOf('PHPExcel_Worksheet_Row', $row); $this->assertInstanceOf('\PHPExcel\Worksheet\Row', $row);
$rowIndex = $row->getRowIndex(); $rowIndex = $row->getRowIndex();
$this->assertEquals(1, $rowIndex); $this->assertEquals(1, $rowIndex);
} }
public function testInstantiateRowSpecified() public function testInstantiateRowSpecified()
{ {
$row = new PHPExcel_Worksheet_Row($this->mockWorksheet, 5); $row = new \PHPExcel\Worksheet\Row($this->mockWorksheet, 5);
$this->assertInstanceOf('PHPExcel_Worksheet_Row', $row); $this->assertInstanceOf('\PHPExcel\Worksheet\Row', $row);
$rowIndex = $row->getRowIndex(); $rowIndex = $row->getRowIndex();
$this->assertEquals(5, $rowIndex); $this->assertEquals(5, $rowIndex);
} }
public function testGetCellIterator() public function testGetCellIterator()
{ {
$row = new PHPExcel_Worksheet_Row($this->mockWorksheet); $row = new \PHPExcel\Worksheet\Row($this->mockWorksheet);
$cellIterator = $row->getCellIterator(); $cellIterator = $row->getCellIterator();
$this->assertInstanceOf('PHPExcel_Worksheet_RowCellIterator', $cellIterator); $this->assertInstanceOf('\PHPExcel\Worksheet\RowCellIterator', $cellIterator);
} }
} }