diff --git a/src/PhpSpreadsheet/Calculation/DateTime.php b/src/PhpSpreadsheet/Calculation/DateTime.php index 291a982a..2bafcc9e 100644 --- a/src/PhpSpreadsheet/Calculation/DateTime.php +++ b/src/PhpSpreadsheet/Calculation/DateTime.php @@ -1489,7 +1489,7 @@ class DateTime case Functions::RETURNDATE_EXCEL: return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject); 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: return $PHPDateObject; } diff --git a/src/PhpSpreadsheet/Chart/DataSeriesValues.php b/src/PhpSpreadsheet/Chart/DataSeriesValues.php index a318cea2..fc5e0941 100644 --- a/src/PhpSpreadsheet/Chart/DataSeriesValues.php +++ b/src/PhpSpreadsheet/Chart/DataSeriesValues.php @@ -3,7 +3,7 @@ namespace PHPExcel\Chart; /** - * PHPExcel_Chart_DataSeriesValues + * \PHPExcel\Chart\DataSeriesValues * * Copyright (c) 2006 - 2015 PHPExcel * diff --git a/src/PhpSpreadsheet/Chart/Layout.php b/src/PhpSpreadsheet/Chart/Layout.php index e0d081ce..1b78eee6 100644 --- a/src/PhpSpreadsheet/Chart/Layout.php +++ b/src/PhpSpreadsheet/Chart/Layout.php @@ -3,7 +3,7 @@ namespace PHPExcel\Chart; /** - * PHPExcel_Chart_Layout + * \PHPExcel\Chart\Layout * * Copyright (c) 2006 - 2015 PHPExcel * diff --git a/src/PhpSpreadsheet/Chart/Legend.php b/src/PhpSpreadsheet/Chart/Legend.php index f9dc6d0e..237a7a55 100644 --- a/src/PhpSpreadsheet/Chart/Legend.php +++ b/src/PhpSpreadsheet/Chart/Legend.php @@ -3,7 +3,7 @@ namespace PHPExcel\Chart; /** - * PHPExcel_Chart_Legend + * \PHPExcel\Chart\Legend * * Copyright (c) 2006 - 2015 PHPExcel * diff --git a/src/PhpSpreadsheet/Reader/CSV.php b/src/PhpSpreadsheet/Reader/CSV.php index 76ea6f1d..ef5a4972 100644 --- a/src/PhpSpreadsheet/Reader/CSV.php +++ b/src/PhpSpreadsheet/Reader/CSV.php @@ -1,6 +1,7 @@ m, $nx); } else { - throw new PHPExcel_Calculation_Exception(JAMAError(MatrixSPDException)); + throw new \PHPExcel\Calculation\Exception(JAMAError(MatrixSPDException)); } } else { - throw new PHPExcel_Calculation_Exception(JAMAError(MATRIX_DIMENSION_EXCEPTION)); + throw new \PHPExcel\Calculation\Exception(JAMAError(MATRIX_DIMENSION_EXCEPTION)); } } else { - throw new PHPExcel_Calculation_Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); + throw new \PHPExcel\Calculation\Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); } } // function solve() } diff --git a/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php b/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php index d4ae3979..bcecfdd4 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php +++ b/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php @@ -1,4 +1,7 @@ LU = $A->getArray(); $this->m = $A->getRowDimension(); @@ -115,7 +118,7 @@ class PHPExcel_Shared_JAMA_LUDecomposition } } } else { - throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(Matrix::ARGUMENT_TYPE_EXCEPTION); } } // function __construct() @@ -137,7 +140,7 @@ class PHPExcel_Shared_JAMA_LUDecomposition } } } - return new PHPExcel_Shared_JAMA_Matrix($L); + return new Matrix($L); } // function getL() /** @@ -156,7 +159,7 @@ class PHPExcel_Shared_JAMA_LUDecomposition } } } - return new PHPExcel_Shared_JAMA_Matrix($U); + return new Matrix($U); } // function getU() /** @@ -208,7 +211,7 @@ class PHPExcel_Shared_JAMA_LUDecomposition } return $d; } else { - throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::MATRIX_DIMENSION_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(Matrix::MATRIX_DIMENSION_EXCEPTION); } } // 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. * @return X so that L*U*X = B(piv,:) - * @PHPExcel_Calculation_Exception IllegalArgumentException Matrix row dimensions must agree. - * @PHPExcel_Calculation_Exception RuntimeException Matrix is singular. + * @\PHPExcel\Calculation\Exception IllegalArgumentException Matrix row dimensions must agree. + * @\PHPExcel\Calculation\Exception RuntimeException Matrix is singular. */ public function solve($B) { @@ -248,10 +251,10 @@ class PHPExcel_Shared_JAMA_LUDecomposition } return $X; } else { - throw new PHPExcel_Calculation_Exception(self::MATRIX_SINGULAR_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::MATRIX_SINGULAR_EXCEPTION); } } else { - throw new PHPExcel_Calculation_Exception(self::MATRIX_SQUARE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::MATRIX_SQUARE_EXCEPTION); } } } diff --git a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php index 82fb0fb2..9158de25 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php +++ b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php @@ -1,17 +1,6 @@ = 0) { $m = $this->m - $i0; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if ($j0 >= 0) { $n = $this->n - $j0; } 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 ($j = $j0; $j < $this->n; ++$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)) { $m = $iF - $i0; } 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)) { $n = $jF - $j0; } 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 ($j = $j0; $j <= $jF; ++$j) { $R->set($i - $i0, $j - $j0, $this->A[$i][$j]); @@ -221,14 +210,14 @@ class PHPExcel_Shared_JAMA_Matrix if (count($RL) > 0) { $m = count($RL); } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } 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 ($j = 0; $j < $n; ++$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) { $m = count($RL); } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } 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 ($j = 0; $j < $n; ++$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)) { $m = $iF - $i0; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } 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 ($j = 0; $j < $n; ++$j) { $R->set($i - $i0, $j, $this->A[$RL[$i]][$j]); @@ -284,14 +273,14 @@ class PHPExcel_Shared_JAMA_Matrix if (count($RL) > 0) { $m = count($RL); } 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)) { $n = $jF - $j0; } 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 ($j = $j0; $j <= $jF; ++$j) { $R->set($i, $j - $j0, $this->A[$RL[$i]][$j]); @@ -300,11 +289,11 @@ class PHPExcel_Shared_JAMA_Matrix return $R; break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } } 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) { - if ($B instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($B instanceof Matrix) { if (($this->m == $B->getRowDimension()) && ($this->n == $B->getColumnDimension())) { return true; } else { - throw new PHPExcel_Calculation_Exception(self::MATRIX_DIMENSION_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::MATRIX_DIMENSION_EXCEPTION); } } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } } // function checkMatrixDimensions() @@ -367,7 +356,7 @@ class PHPExcel_Shared_JAMA_Matrix */ 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) { $R->set($i, $i, $c); } @@ -391,7 +380,7 @@ class PHPExcel_Shared_JAMA_Matrix return $this->getMatrix($i0, 0, $i0 + 1, $this->n); } } 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); } } 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() { - $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 ($j = 0; $j < $this->n; ++$j) { $R->set($j, $i, $this->A[$i][$j]); @@ -474,17 +463,17 @@ class PHPExcel_Shared_JAMA_Matrix switch ($match) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $M = new Matrix($args[0]); break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -495,7 +484,7 @@ class PHPExcel_Shared_JAMA_Matrix } return $M; } 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) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $M = new Matrix($args[0]); break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -534,11 +523,11 @@ class PHPExcel_Shared_JAMA_Matrix $value = $M->get($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], '"'); - $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))) { $value = trim($value, '"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); + $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] += $value; @@ -549,7 +538,7 @@ class PHPExcel_Shared_JAMA_Matrix } return $this; } 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) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $M = new Matrix($args[0]); break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -589,7 +578,7 @@ class PHPExcel_Shared_JAMA_Matrix } return $M; } 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) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $M = new Matrix($args[0]); break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -628,11 +617,11 @@ class PHPExcel_Shared_JAMA_Matrix $value = $M->get($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], '"'); - $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))) { $value = trim($value, '"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); + $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] -= $value; @@ -643,7 +632,7 @@ class PHPExcel_Shared_JAMA_Matrix } return $this; } 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) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $M = new Matrix($args[0]); break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -684,7 +673,7 @@ class PHPExcel_Shared_JAMA_Matrix } return $M; } 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) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $M = new Matrix($args[0]); break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -724,11 +713,11 @@ class PHPExcel_Shared_JAMA_Matrix $value = $M->get($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], '"'); - $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))) { $value = trim($value, '"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); + $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] *= $value; @@ -739,7 +728,7 @@ class PHPExcel_Shared_JAMA_Matrix } return $this; } 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) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $M = new Matrix($args[0]); break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -779,11 +768,11 @@ class PHPExcel_Shared_JAMA_Matrix $value = $M->get($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], '"'); - $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))) { $value = trim($value, '"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); + $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($value); } if ($validValues) { if ($value == 0) { @@ -799,7 +788,7 @@ class PHPExcel_Shared_JAMA_Matrix } return $M; } 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) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $M = new Matrix($args[0]); break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -841,7 +830,7 @@ class PHPExcel_Shared_JAMA_Matrix } return $M; } 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) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $M = new Matrix($args[0]); break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -883,7 +872,7 @@ class PHPExcel_Shared_JAMA_Matrix } return $M; } 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) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $M = new Matrix($args[0]); break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -925,7 +914,7 @@ class PHPExcel_Shared_JAMA_Matrix } return $M; } 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) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $B = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } 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 ($k = 0; $k < $this->n; ++$k) { $Bcolj[$k] = $B->A[$k][$j]; @@ -967,13 +956,13 @@ class PHPExcel_Shared_JAMA_Matrix } return $C; } else { - throw new PHPExcel_Calculation_Exception(JAMAError(MatrixDimensionMismatch)); + throw new \PHPExcel\Calculation\Exception(JAMAError(MatrixDimensionMismatch)); } break; case 'array': - $B = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $B = new Matrix($args[0]); 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 ($j = 0; $j < $C->n; ++$j) { $s = "0"; @@ -985,12 +974,12 @@ class PHPExcel_Shared_JAMA_Matrix } return $C; } else { - throw new PHPExcel_Calculation_Exception(JAMAError(MatrixDimensionMismatch)); + throw new \PHPExcel\Calculation\Exception(JAMAError(MatrixDimensionMismatch)); } return $M; break; case 'integer': - $C = new PHPExcel_Shared_JAMA_Matrix($this->A); + $C = new Matrix($this->A); for ($i = 0; $i < $C->m; ++$i) { for ($j = 0; $j < $C->n; ++$j) { $C->A[$i][$j] *= $args[0]; @@ -999,7 +988,7 @@ class PHPExcel_Shared_JAMA_Matrix return $C; break; 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 ($j = 0; $j < $C->n; ++$j) { $C->A[$i][$j] = $args[0] * $this->A[$i][$j]; @@ -1008,7 +997,7 @@ class PHPExcel_Shared_JAMA_Matrix return $C; break; case 'float': - $C = new PHPExcel_Shared_JAMA_Matrix($this->A); + $C = new Matrix($this->A); for ($i = 0; $i < $C->m; ++$i) { for ($j = 0; $j < $C->n; ++$j) { $C->A[$i][$j] *= $args[0]; @@ -1017,11 +1006,11 @@ class PHPExcel_Shared_JAMA_Matrix return $C; break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } } 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) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $M = new Matrix($args[0]); break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -1060,11 +1049,11 @@ class PHPExcel_Shared_JAMA_Matrix $value = $M->get($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], '"'); - $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))) { $value = trim($value, '"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); + $validValues &= \PHPExcel\Shared\String::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] = pow($this->A[$i][$j], $value); @@ -1075,7 +1064,7 @@ class PHPExcel_Shared_JAMA_Matrix } return $this; } 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) { case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { + if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); + $M = new Matrix($args[0]); break; default: - throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -1114,7 +1103,7 @@ class PHPExcel_Shared_JAMA_Matrix } return $this; } 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) { if ($this->m == $this->n) { - $LU = new PHPExcel_Shared_JAMA_LUDecomposition($this); + $LU = new LUDecomposition($this); return $LU->solve($B); } else { $QR = new PHPExcel_Shared_JAMA_QRDecomposition($this); @@ -1153,7 +1142,7 @@ class PHPExcel_Shared_JAMA_Matrix */ public function det() { - $L = new PHPExcel_Shared_JAMA_LUDecomposition($this); + $L = new LUDecomposition($this); return $L->det(); } } diff --git a/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php b/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php index 1e43c7c4..9178ce72 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php +++ b/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php @@ -1,4 +1,7 @@ QR = $A->getArrayCopy(); $this->m = $A->getRowDimension(); @@ -89,7 +92,7 @@ class PHPExcel_Shared_JAMA_QRDecomposition $this->Rdiag[$k] = -$nrm; } } else { - throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::ARGUMENT_TYPE_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(Matrix::ARGUMENT_TYPE_EXCEPTION); } } // function __construct() @@ -125,7 +128,7 @@ class PHPExcel_Shared_JAMA_QRDecomposition } } } - return new PHPExcel_Shared_JAMA_Matrix($H); + return new Matrix($H); } // function getH() /** @@ -146,7 +149,7 @@ class PHPExcel_Shared_JAMA_QRDecomposition } } } - return new PHPExcel_Shared_JAMA_Matrix($R); + return new Matrix($R); } // function getR() /** @@ -183,7 +186,7 @@ class PHPExcel_Shared_JAMA_QRDecomposition } } */ - return new PHPExcel_Shared_JAMA_Matrix($Q); + return new Matrix($Q); } // 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)); } else { - throw new PHPExcel_Calculation_Exception(self::MATRIX_RANK_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(self::MATRIX_RANK_EXCEPTION); } } else { - throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::MATRIX_DIMENSION_EXCEPTION); + throw new \PHPExcel\Calculation\Exception(Matrix::MATRIX_DIMENSION_EXCEPTION); } } } diff --git a/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php b/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php index f57d122c..b25a7708 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php +++ b/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php @@ -1,4 +1,7 @@ PHPExcel_Cell::columnIndexFromString($this->subject->getHighestColumn()) - 1) { - throw new PHPExcel_Exception("Start column ({$startColumn}) is beyond highest column ({$this->subject->getHighestColumn()})"); + if ($startColumnIndex > Cell::columnIndexFromString($this->subject->getHighestColumn()) - 1) { + throw new Exception("Start column ({$startColumn}) is beyond highest column ({$this->subject->getHighestColumn()})"); } $this->startColumn = $startColumnIndex; diff --git a/src/PhpSpreadsheet/Worksheet/Dimension.php b/src/PhpSpreadsheet/Worksheet/Dimension.php index 7b197e0c..eaec1fde 100644 --- a/src/PhpSpreadsheet/Worksheet/Dimension.php +++ b/src/PhpSpreadsheet/Worksheet/Dimension.php @@ -3,7 +3,7 @@ namespace PHPExcel\Worksheet; /** - * PHPExcel_Worksheet_Dimension + * \PHPExcel\Worksheet_Dimension * * Copyright (c) 2006 - 2015 PHPExcel * @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Worksheet/Drawing.php b/src/PhpSpreadsheet/Worksheet/Drawing.php index 7ad76ef7..e494702d 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing.php @@ -3,7 +3,7 @@ namespace PHPExcel\Worksheet; /** - * PHPExcel_Worksheet_Drawing + * \PHPExcel\Worksheet_Drawing * * Copyright (c) 2006 - 2015 PHPExcel * @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet_Drawing + * @package \PHPExcel\Worksheet_Drawing * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php index 3431af82..9335c7a7 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php @@ -3,7 +3,7 @@ namespace PHPExcel\Worksheet\Drawing; /** - * PHPExcel_Worksheet_Drawing_Shadow + * \PHPExcel\Worksheet_Drawing_Shadow * * 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 * * @category PHPExcel - * @package PHPExcel_Worksheet_Drawing + * @package \PHPExcel\Worksheet_Drawing * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php index 557d201e..688ecc0b 100644 --- a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php +++ b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php @@ -3,7 +3,7 @@ namespace PHPExcel\Worksheet; /** - * PHPExcel_Worksheet_HeaderFooter + * \PHPExcel\Worksheet_HeaderFooter * * Copyright (c) 2006 - 2015 PHPExcel * @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php b/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php index a2453dfb..71ecc3cd 100644 --- a/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php @@ -3,7 +3,7 @@ namespace PHPExcel\Worksheet; /** - * PHPExcel_Worksheet_HeaderFooterDrawing + * \PHPExcel\Worksheet_HeaderFooterDrawing * * Copyright (c) 2006 - 2015 PHPExcel * @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php index d4a2d7c8..b2fab11f 100644 --- a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php @@ -3,7 +3,7 @@ namespace PHPExcel\Worksheet; /** - * PHPExcel_Worksheet_MemoryDrawing + * \PHPExcel\Worksheet_MemoryDrawing * * Copyright (c) 2006 - 2015 PHPExcel * @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Worksheet/PageMargins.php b/src/PhpSpreadsheet/Worksheet/PageMargins.php index 3cf69def..dc4fe3fd 100644 --- a/src/PhpSpreadsheet/Worksheet/PageMargins.php +++ b/src/PhpSpreadsheet/Worksheet/PageMargins.php @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Worksheet/PageSetup.php b/src/PhpSpreadsheet/Worksheet/PageSetup.php index 7aea326b..ac8297a8 100644 --- a/src/PhpSpreadsheet/Worksheet/PageSetup.php +++ b/src/PhpSpreadsheet/Worksheet/PageSetup.php @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## @@ -99,7 +99,7 @@ namespace PHPExcel\Worksheet; * * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) */ class PageSetup diff --git a/src/PhpSpreadsheet/Worksheet/Protection.php b/src/PhpSpreadsheet/Worksheet/Protection.php index 87d5cd91..92f78bb6 100644 --- a/src/PhpSpreadsheet/Worksheet/Protection.php +++ b/src/PhpSpreadsheet/Worksheet/Protection.php @@ -3,7 +3,7 @@ namespace PHPExcel\Worksheet; /** - * PHPExcel_Worksheet_Protection + * \PHPExcel\Worksheet_Protection * * Copyright (c) 2006 - 2015 PHPExcel * @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Worksheet/Row.php b/src/PhpSpreadsheet/Worksheet/Row.php index ee73d8cc..d9e3f927 100644 --- a/src/PhpSpreadsheet/Worksheet/Row.php +++ b/src/PhpSpreadsheet/Worksheet/Row.php @@ -3,7 +3,7 @@ namespace PHPExcel\Worksheet; /** - * PHPExcel_Worksheet_Row + * \PHPExcel\Worksheet\Row * * Copyright (c) 2006 - 2015 PHPExcel * @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Worksheet/RowCellIterator.php b/src/PhpSpreadsheet/Worksheet/RowCellIterator.php index 223bbef8..41852348 100644 --- a/src/PhpSpreadsheet/Worksheet/RowCellIterator.php +++ b/src/PhpSpreadsheet/Worksheet/RowCellIterator.php @@ -3,7 +3,7 @@ namespace PHPExcel\Worksheet; /** - * PHPExcel_Worksheet_RowCellIterator + * \PHPExcel\Worksheet\RowCellIterator * * Copyright (c) 2006 - 2015 PHPExcel * @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Worksheet/RowDimension.php b/src/PhpSpreadsheet/Worksheet/RowDimension.php index a217784f..8bfa954c 100644 --- a/src/PhpSpreadsheet/Worksheet/RowDimension.php +++ b/src/PhpSpreadsheet/Worksheet/RowDimension.php @@ -3,7 +3,7 @@ namespace PHPExcel\Worksheet; /** - * PHPExcel_Worksheet_RowDimension + * \PHPExcel\Worksheet\RowDimension * * Copyright (c) 2006 - 2015 PHPExcel * @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Worksheet/RowIterator.php b/src/PhpSpreadsheet/Worksheet/RowIterator.php index 80c887f8..98ff0133 100644 --- a/src/PhpSpreadsheet/Worksheet/RowIterator.php +++ b/src/PhpSpreadsheet/Worksheet/RowIterator.php @@ -3,7 +3,7 @@ namespace PHPExcel\Worksheet; /** - * PHPExcel_Worksheet_RowIterator + * \PHPExcel\Worksheet\RowIterator * * Copyright (c) 2006 - 2015 PHPExcel * @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Worksheet/SheetView.php b/src/PhpSpreadsheet/Worksheet/SheetView.php index d9b68c18..94cf641b 100644 --- a/src/PhpSpreadsheet/Worksheet/SheetView.php +++ b/src/PhpSpreadsheet/Worksheet/SheetView.php @@ -3,7 +3,7 @@ namespace PHPExcel\Worksheet; /** - * PHPExcel_Worksheet_SheetView + * \PHPExcel\Worksheet_SheetView * * Copyright (c) 2006 - 2015 PHPExcel * @@ -22,7 +22,7 @@ namespace PHPExcel\Worksheet; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel - * @package PHPExcel_Worksheet + * @package \PHPExcel\Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Chart.php b/src/PhpSpreadsheet/Writer/Excel2007/Chart.php index 84fceb33..507f46b7 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Chart.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Chart.php @@ -1,5 +1,6 @@ startElement('c:cat'); } - $this->writePlotSeriesValues($plotSeriesCategory, $objWriter, $groupType, 'str', $pSheet); + $this->writePlotSeriesValues($plotSeriesCategory, $objWriter, $groupType, 'str'); $objWriter->endElement(); } @@ -1204,12 +1205,12 @@ class Chart extends WriterPart $objWriter->startElement('c:val'); } - $this->writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, 'num', $pSheet); + $this->writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, 'num'); $objWriter->endElement(); } if ($groupType === DataSeries::TYPE_BUBBLECHART) { - $this->writeBubbles($plotSeriesValues, $objWriter, $pSheet); + $this->writeBubbles($plotSeriesValues, $objWriter); } $objWriter->endElement(); @@ -1264,7 +1265,7 @@ class Chart extends WriterPart * * @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)) { return; @@ -1356,7 +1357,7 @@ class Chart extends WriterPart * * @throws \PHPExcel\Writer\Exception */ - private function writeBubbles($plotSeriesValues, $objWriter, \PHPExcel\Worksheet $pSheet) + private function writeBubbles($plotSeriesValues, $objWriter) { if (is_null($plotSeriesValues)) { return; diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Workbook.php b/src/PhpSpreadsheet/Writer/Excel2007/Workbook.php index 8df8190e..a8bf24ef 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Workbook.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Workbook.php @@ -39,7 +39,6 @@ class Workbook extends WriterPart public function writeWorkbook(\PHPExcel\SpreadSheet $pPHPExcel = null, $recalcRequired = false) { // Create XML writer - $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { @@ -90,7 +89,7 @@ class Workbook extends WriterPart * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer * @throws \PHPExcel\Writer\Exception */ - private function writeFileVersion(\PHPExcel\Shared\XMLWriter $objWriter = null) + private function writeFileVersion(\PHPExcel\Shared\XMLWriter $objWriter) { $objWriter->startElement('fileVersion'); $objWriter->writeAttribute('appName', 'xl'); @@ -106,7 +105,7 @@ class Workbook extends WriterPart * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer * @throws \PHPExcel\Writer\Exception */ - private function writeWorkbookPr(\PHPExcel\Shared\XMLWriter $objWriter = null) + private function writeWorkbookPr(\PHPExcel\Shared\XMLWriter $objWriter) { $objWriter->startElement('workbookPr'); @@ -126,7 +125,7 @@ class Workbook extends WriterPart * @param PHPExcel $pPHPExcel * @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 $objWriter->startElement('bookViews'); @@ -156,7 +155,7 @@ class Workbook extends WriterPart * @param PHPExcel $pPHPExcel * @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()) { $objWriter->startElement('workbookProtection'); @@ -183,7 +182,7 @@ class Workbook extends WriterPart * @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing * @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'); @@ -206,7 +205,7 @@ class Workbook extends WriterPart * @param PHPExcel $pPHPExcel * @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 $objWriter->startElement('sheets'); @@ -235,7 +234,7 @@ class Workbook extends WriterPart * @param string $sheetState Sheet state (visible, hidden, veryHidden) * @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 != '') { // Write sheet @@ -259,7 +258,7 @@ class Workbook extends WriterPart * @param PHPExcel $pPHPExcel * @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 $objWriter->startElement('definedNames'); @@ -290,10 +289,10 @@ class Workbook extends WriterPart * Write named ranges * * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param PHPExcel $pPHPExcel + * @param \PHPExcel\SpreadSheet $pPHPExcel * @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 $namedRanges = $pPHPExcel->getNamedRanges(); @@ -309,7 +308,7 @@ class Workbook extends WriterPart * @param \PHPExcel\NamedRange $pNamedRange * @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 $objWriter->startElement('definedName'); @@ -341,7 +340,7 @@ class Workbook extends WriterPart * @param int $pSheetId * @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 $autoFilterRange = $pSheet->getAutoFilter()->getRange(); @@ -377,7 +376,7 @@ class Workbook extends WriterPart * @param int $pSheetId * @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 if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet() || $pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) { @@ -420,7 +419,7 @@ class Workbook extends WriterPart * @param int $pSheetId * @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 if ($pSheet->getPageSetup()->isPrintAreaSet()) { diff --git a/src/PhpSpreadsheet/Writer/HTML.php b/src/PhpSpreadsheet/Writer/HTML.php index fe328758..1859a16e 100644 --- a/src/PhpSpreadsheet/Writer/HTML.php +++ b/src/PhpSpreadsheet/Writer/HTML.php @@ -1,6 +1,7 @@ assertEquals($expectedResult, $result, null, 1E-8); } @@ -34,17 +29,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testDATEtoPHP() { - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); - $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_PHP_NUMERIC); + $result = \PHPExcel\Calculation\DateTime::DATE(2012, 1, 31); + \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); $this->assertEquals(1327968000, $result, null, 1E-8); } public function testDATEtoPHPObject() { - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT); - $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_PHP_OBJECT); + $result = \PHPExcel\Calculation\DateTime::DATE(2012, 1, 31); + \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); // Must return an object... $this->assertTrue(is_object($result)); // ... of the correct type @@ -55,17 +50,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testDATEwith1904Calendar() { - PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904); - $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_MAC_1904); + $result = \PHPExcel\Calculation\DateTime::DATE(1918, 11, 11); + \PHPExcel\Shared\Date::setExcelCalendar(\PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900); $this->assertEquals($result, 5428); } public function testDATEwith1904CalendarError() { - PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904); - $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_MAC_1904); + $result = \PHPExcel\Calculation\DateTime::DATE(1901, 1, 31); + \PHPExcel\Shared\Date::setExcelCalendar(\PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900); $this->assertEquals($result, '#NUM!'); } @@ -76,7 +71,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -87,17 +82,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testDATEVALUEtoPHP() { - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); - $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_PHP_NUMERIC); + $result = \PHPExcel\Calculation\DateTime::DATEVALUE('2012-1-31'); + \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); $this->assertEquals(1327968000, $result, null, 1E-8); } public function testDATEVALUEtoPHPObject() { - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT); - $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_PHP_OBJECT); + $result = \PHPExcel\Calculation\DateTime::DATEVALUE('2012-1-31'); + \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); // Must return an object... $this->assertTrue(is_object($result)); // ... of the correct type @@ -113,7 +108,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -129,7 +124,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -145,7 +140,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -161,7 +156,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -177,7 +172,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -193,7 +188,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -204,17 +199,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testTIMEtoPHP() { - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); - $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_PHP_NUMERIC); + $result = \PHPExcel\Calculation\DateTime::TIME(7, 30, 20); + \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); $this->assertEquals(27020, $result, null, 1E-8); } public function testTIMEtoPHPObject() { - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT); - $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_PHP_OBJECT); + $result = \PHPExcel\Calculation\DateTime::TIME(7, 30, 20); + \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); // Must return an object... $this->assertTrue(is_object($result)); // ... of the correct type @@ -230,7 +225,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -241,17 +236,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testTIMEVALUEtoPHP() { - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); - $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_PHP_NUMERIC); + $result = \PHPExcel\Calculation\DateTime::TIMEVALUE('7:30:20'); + \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); $this->assertEquals(23420, $result, null, 1E-8); } public function testTIMEVALUEtoPHPObject() { - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT); - $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_PHP_OBJECT); + $result = \PHPExcel\Calculation\DateTime::TIMEVALUE('7:30:20'); + \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); // Must return an object... $this->assertTrue(is_object($result)); // ... of the correct type @@ -267,7 +262,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -283,7 +278,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -299,7 +294,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -315,7 +310,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -331,7 +326,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -347,7 +342,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -358,17 +353,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testEDATEtoPHP() { - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); - $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_PHP_NUMERIC); + $result = \PHPExcel\Calculation\DateTime::EDATE('2012-1-26', -1); + \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); $this->assertEquals(1324857600, $result, null, 1E-8); } public function testEDATEtoPHPObject() { - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT); - $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_PHP_OBJECT); + $result = \PHPExcel\Calculation\DateTime::EDATE('2012-1-26', -1); + \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); // Must return an object... $this->assertTrue(is_object($result)); // ... of the correct type @@ -384,7 +379,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -395,17 +390,17 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testEOMONTHtoPHP() { - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC); - $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_PHP_NUMERIC); + $result = \PHPExcel\Calculation\DateTime::EOMONTH('2012-1-26', -1); + \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); $this->assertEquals(1325289600, $result, null, 1E-8); } public function testEOMONTHtoPHPObject() { - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT); - $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_PHP_OBJECT); + $result = \PHPExcel\Calculation\DateTime::EOMONTH('2012-1-26', -1); + \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); // Must return an object... $this->assertTrue(is_object($result)); // ... of the correct type @@ -421,7 +416,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -437,7 +432,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -453,7 +448,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } diff --git a/unitTests/Classes/src/Calculation/EngineeringTest.php b/unitTests/Classes/src/Calculation/EngineeringTest.php index 08448f55..8d2c9e97 100644 --- a/unitTests/Classes/src/Calculation/EngineeringTest.php +++ b/unitTests/Classes/src/Calculation/EngineeringTest.php @@ -12,12 +12,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL); + \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL); } /** @@ -27,7 +22,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -43,7 +38,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -59,7 +54,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -75,7 +70,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -91,7 +86,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -107,7 +102,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -123,7 +118,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -139,7 +134,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -155,7 +150,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -171,7 +166,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -188,7 +183,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -205,7 +200,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -222,7 +217,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -239,7 +234,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -256,7 +251,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -273,7 +268,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -290,7 +285,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -307,7 +302,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -324,7 +319,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -341,7 +336,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -358,7 +353,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -375,7 +370,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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(); $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage()); } @@ -392,7 +387,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -408,7 +403,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -424,7 +419,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -440,7 +435,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -456,7 +451,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -472,7 +467,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -488,7 +483,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -504,7 +499,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -520,7 +515,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -536,7 +531,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -552,7 +547,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -568,7 +563,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -584,7 +579,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -600,7 +595,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -616,7 +611,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -632,7 +627,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -643,25 +638,25 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testGetConversionGroups() { - $result = PHPExcel_Calculation_Engineering::getConversionGroups(); + $result = \PHPExcel\Calculation\Engineering::getConversionGroups(); $this->assertInternalType('array', $result); } public function testGetConversionGroupUnits() { - $result = PHPExcel_Calculation_Engineering::getConversionGroupUnits(); + $result = \PHPExcel\Calculation\Engineering::getConversionGroupUnits(); $this->assertInternalType('array', $result); } public function testGetConversionGroupUnitDetails() { - $result = PHPExcel_Calculation_Engineering::getConversionGroupUnitDetails(); + $result = \PHPExcel\Calculation\Engineering::getConversionGroupUnitDetails(); $this->assertInternalType('array', $result); } public function testGetConversionMultipliers() { - $result = PHPExcel_Calculation_Engineering::getConversionMultipliers(); + $result = \PHPExcel\Calculation\Engineering::getConversionMultipliers(); $this->assertInternalType('array', $result); } @@ -672,7 +667,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } diff --git a/unitTests/Classes/src/Calculation/FinancialTest.php b/unitTests/Classes/src/Calculation/FinancialTest.php index f6e39814..fd6a1b11 100644 --- a/unitTests/Classes/src/Calculation/FinancialTest.php +++ b/unitTests/Classes/src/Calculation/FinancialTest.php @@ -8,12 +8,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL); + \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL); } /** @@ -23,7 +18,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -39,7 +34,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -55,7 +50,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -71,7 +66,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -87,7 +82,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -103,7 +98,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -119,7 +114,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -135,7 +130,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -151,7 +146,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -167,7 +162,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -183,7 +178,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -199,7 +194,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -215,7 +210,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -231,7 +226,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -247,7 +242,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -263,7 +258,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -279,7 +274,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -295,7 +290,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -311,7 +306,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -327,7 +322,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -343,7 +338,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -359,7 +354,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -375,7 +370,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -391,7 +386,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -407,7 +402,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -423,7 +418,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -439,7 +434,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -455,7 +450,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -471,7 +466,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -487,7 +482,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -503,7 +498,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } diff --git a/unitTests/Classes/src/Calculation/FunctionsTest.php b/unitTests/Classes/src/Calculation/FunctionsTest.php index 61c48205..7337525a 100644 --- a/unitTests/Classes/src/Calculation/FunctionsTest.php +++ b/unitTests/Classes/src/Calculation/FunctionsTest.php @@ -8,59 +8,54 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL); + \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL); } public function testDUMMY() { - $result = PHPExcel_Calculation_Functions::DUMMY(); + $result = \PHPExcel\Calculation\Functions::DUMMY(); $this->assertEquals('#Not Yet Implemented', $result); } public function testDIV0() { - $result = PHPExcel_Calculation_Functions::DIV0(); + $result = \PHPExcel\Calculation\Functions::DIV0(); $this->assertEquals('#DIV/0!', $result); } public function testNA() { - $result = PHPExcel_Calculation_Functions::NA(); + $result = \PHPExcel\Calculation\Functions::NA(); $this->assertEquals('#N/A', $result); } public function testNaN() { - $result = PHPExcel_Calculation_Functions::NaN(); + $result = \PHPExcel\Calculation\Functions::NaN(); $this->assertEquals('#NUM!', $result); } public function testNAME() { - $result = PHPExcel_Calculation_Functions::NAME(); + $result = \PHPExcel\Calculation\Functions::NAME(); $this->assertEquals('#NAME?', $result); } public function testREF() { - $result = PHPExcel_Calculation_Functions::REF(); + $result = \PHPExcel\Calculation\Functions::REF(); $this->assertEquals('#REF!', $result); } public function testNULL() { - $result = PHPExcel_Calculation_Functions::null(); + $result = \PHPExcel\Calculation\Functions::null(); $this->assertEquals('#NULL!', $result); } public function testVALUE() { - $result = PHPExcel_Calculation_Functions::VALUE(); + $result = \PHPExcel\Calculation\Functions::VALUE(); $this->assertEquals('#VALUE!', $result); } @@ -71,7 +66,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -87,7 +82,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -103,7 +98,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -119,7 +114,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -135,7 +130,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -151,7 +146,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -167,7 +162,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -183,7 +178,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -199,7 +194,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -215,7 +210,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -231,7 +226,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -247,7 +242,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -263,7 +258,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } diff --git a/unitTests/Classes/src/Calculation/LogicalTest.php b/unitTests/Classes/src/Calculation/LogicalTest.php index e475c30f..e370a498 100644 --- a/unitTests/Classes/src/Calculation/LogicalTest.php +++ b/unitTests/Classes/src/Calculation/LogicalTest.php @@ -8,23 +8,18 @@ class LogicalTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL); + \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL); } public function testTRUE() { - $result = PHPExcel_Calculation_Logical::TRUE(); + $result = \PHPExcel\Calculation\Logical::TRUE(); $this->assertEquals(true, $result); } public function testFALSE() { - $result = PHPExcel_Calculation_Logical::FALSE(); + $result = \PHPExcel\Calculation\Logical::FALSE(); $this->assertEquals(false, $result); } @@ -35,7 +30,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -51,7 +46,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -67,7 +62,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -83,7 +78,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -99,7 +94,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } diff --git a/unitTests/Classes/src/Calculation/LookupRefTest.php b/unitTests/Classes/src/Calculation/LookupRefTest.php index 1408b73b..f00befcc 100644 --- a/unitTests/Classes/src/Calculation/LookupRefTest.php +++ b/unitTests/Classes/src/Calculation/LookupRefTest.php @@ -8,12 +8,7 @@ class LookupRefTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL); + \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL); } /** @@ -23,7 +18,7 @@ class LookupRefTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -39,7 +34,7 @@ class LookupRefTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } diff --git a/unitTests/Classes/src/Calculation/MathTrigTest.php b/unitTests/Classes/src/Calculation/MathTrigTest.php index 40d1c505..1cf13bce 100644 --- a/unitTests/Classes/src/Calculation/MathTrigTest.php +++ b/unitTests/Classes/src/Calculation/MathTrigTest.php @@ -8,12 +8,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL); + \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL); } /** @@ -23,7 +18,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -39,7 +34,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -55,7 +50,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -71,7 +66,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -87,7 +82,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -103,7 +98,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -119,7 +114,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -135,7 +130,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -151,7 +146,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -167,7 +162,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -183,7 +178,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -199,7 +194,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -215,7 +210,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -231,7 +226,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -247,7 +242,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -263,7 +258,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -279,7 +274,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -295,7 +290,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -311,7 +306,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -327,9 +322,9 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_args(); $expectedResult = array_pop($args); - PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE); - $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_VALUE); + $result = call_user_func_array(array('\PHPExcel\Calculation\MathTrig','MROUND'), $args); + \PHPExcel\Calculation::setArrayReturnType(\PHPExcel\Calculation::RETURN_ARRAY_AS_ARRAY); $this->assertEquals($expectedResult, $result, null, 1E-12); } @@ -345,7 +340,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -361,7 +356,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -377,7 +372,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -393,7 +388,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -409,7 +404,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -425,7 +420,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -441,7 +436,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -457,7 +452,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -473,7 +468,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -489,7 +484,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } diff --git a/unitTests/Classes/src/Calculation/TextDataTest.php b/unitTests/Classes/src/Calculation/TextDataTest.php index 135d4b09..39a408cd 100644 --- a/unitTests/Classes/src/Calculation/TextDataTest.php +++ b/unitTests/Classes/src/Calculation/TextDataTest.php @@ -8,12 +8,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL); + \PHPExcel\Calculation\Functions::setCompatibilityMode(\PHPExcel\Calculation\Functions::COMPATIBILITY_EXCEL); } /** @@ -23,7 +18,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -39,7 +34,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -55,7 +50,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -71,7 +66,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -87,7 +82,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -103,7 +98,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -119,7 +114,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -135,7 +130,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -151,7 +146,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -167,7 +162,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -183,7 +178,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -199,7 +194,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -215,7 +210,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -231,7 +226,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -247,7 +242,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -263,7 +258,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -279,7 +274,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -295,7 +290,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -311,7 +306,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -326,13 +321,13 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testTEXT() { // 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', 'setThousandsSeparator'), ','); - call_user_func(array('PHPExcel_Shared_String', 'setCurrencyCode'), '$'); + call_user_func(array('\PHPExcel\Shared\String', 'setDecimalSeparator'), '.'); + call_user_func(array('\PHPExcel\Shared\String', 'setThousandsSeparator'), ','); + call_user_func(array('\PHPExcel\Shared\String', 'setCurrencyCode'), '$'); $args = func_get_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); } @@ -346,13 +341,13 @@ class TextDataTest extends PHPUnit_Framework_TestCase */ public function testVALUE() { - call_user_func(array('PHPExcel_Shared_String', 'setDecimalSeparator'), '.'); - call_user_func(array('PHPExcel_Shared_String', 'setThousandsSeparator'), ' '); - call_user_func(array('PHPExcel_Shared_String', 'setCurrencyCode'), '$'); + call_user_func(array('\PHPExcel\Shared\String', 'setDecimalSeparator'), '.'); + call_user_func(array('\PHPExcel\Shared\String', 'setThousandsSeparator'), ' '); + call_user_func(array('\PHPExcel\Shared\String', 'setCurrencyCode'), '$'); $args = func_get_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); } diff --git a/unitTests/Classes/src/Chart/DataSeriesValuesTest.php b/unitTests/Classes/src/Chart/DataSeriesValuesTest.php index 5bb527cd..b796575e 100644 --- a/unitTests/Classes/src/Chart/DataSeriesValuesTest.php +++ b/unitTests/Classes/src/Chart/DataSeriesValuesTest.php @@ -3,15 +3,6 @@ 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() { $dataTypeValues = array( @@ -19,17 +10,17 @@ class DataSeriesValuesTest extends PHPUnit_Framework_TestCase 'String' ); - $testInstance = new PHPExcel_Chart_DataSeriesValues; + $testInstance = new \PHPExcel\Chart\DataSeriesValues; foreach ($dataTypeValues as $dataTypeValue) { $result = $testInstance->setDataType($dataTypeValue); - $this->assertTrue($result instanceof PHPExcel_Chart_DataSeriesValues); + $this->assertTrue($result instanceof \PHPExcel\Chart\DataSeriesValues); } } public function testSetInvalidDataTypeThrowsException() { - $testInstance = new PHPExcel_Chart_DataSeriesValues; + $testInstance = new \PHPExcel\Chart\DataSeriesValues; try { $result = $testInstance->setDataType('BOOLEAN'); @@ -44,7 +35,7 @@ class DataSeriesValuesTest extends PHPUnit_Framework_TestCase { $dataTypeValue = 'String'; - $testInstance = new PHPExcel_Chart_DataSeriesValues; + $testInstance = new \PHPExcel\Chart\DataSeriesValues; $setValue = $testInstance->setDataType($dataTypeValue); $result = $testInstance->getDataType(); diff --git a/unitTests/Classes/src/Chart/LayoutTest.php b/unitTests/Classes/src/Chart/LayoutTest.php index a06b09b4..8574dfc6 100644 --- a/unitTests/Classes/src/Chart/LayoutTest.php +++ b/unitTests/Classes/src/Chart/LayoutTest.php @@ -3,30 +3,21 @@ 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() { $LayoutTargetValue = 'String'; - $testInstance = new PHPExcel_Chart_Layout; + $testInstance = new \PHPExcel\Chart\Layout; $result = $testInstance->setLayoutTarget($LayoutTargetValue); - $this->assertTrue($result instanceof PHPExcel_Chart_Layout); + $this->assertTrue($result instanceof \PHPExcel\Chart\Layout); } public function testGetLayoutTarget() { $LayoutTargetValue = 'String'; - $testInstance = new PHPExcel_Chart_Layout; + $testInstance = new \PHPExcel\Chart\Layout; $setValue = $testInstance->setLayoutTarget($LayoutTargetValue); $result = $testInstance->getLayoutTarget(); diff --git a/unitTests/Classes/src/Chart/LegendTest.php b/unitTests/Classes/src/Chart/LegendTest.php index b4df4119..e9eced4c 100644 --- a/unitTests/Classes/src/Chart/LegendTest.php +++ b/unitTests/Classes/src/Chart/LegendTest.php @@ -3,26 +3,17 @@ 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() { $positionValues = array( - PHPExcel_Chart_Legend::POSITION_RIGHT, - PHPExcel_Chart_Legend::POSITION_LEFT, - PHPExcel_Chart_Legend::POSITION_TOP, - PHPExcel_Chart_Legend::POSITION_BOTTOM, - PHPExcel_Chart_Legend::POSITION_TOPRIGHT, + \PHPExcel\Chart\Legend::POSITION_RIGHT, + \PHPExcel\Chart\Legend::POSITION_LEFT, + \PHPExcel\Chart\Legend::POSITION_TOP, + \PHPExcel\Chart\Legend::POSITION_BOTTOM, + \PHPExcel\Chart\Legend::POSITION_TOPRIGHT, ); - $testInstance = new PHPExcel_Chart_Legend; + $testInstance = new \PHPExcel\Chart\Legend; foreach ($positionValues as $positionValue) { $result = $testInstance->setPosition($positionValue); @@ -32,20 +23,20 @@ class LegendTest extends PHPUnit_Framework_TestCase public function testSetInvalidPositionReturnsFalse() { - $testInstance = new PHPExcel_Chart_Legend; + $testInstance = new \PHPExcel\Chart\Legend; $result = $testInstance->setPosition('BottomLeft'); $this->assertFalse($result); // Ensure that value is unchanged $result = $testInstance->getPosition(); - $this->assertEquals(PHPExcel_Chart_Legend::POSITION_RIGHT, $result); + $this->assertEquals(\PHPExcel\Chart\Legend::POSITION_RIGHT, $result); } 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); $result = $testInstance->getPosition(); @@ -55,15 +46,15 @@ class LegendTest extends PHPUnit_Framework_TestCase public function testSetPositionXL() { $positionValues = array( - PHPExcel_Chart_Legend::xlLegendPositionBottom, - PHPExcel_Chart_Legend::xlLegendPositionCorner, - PHPExcel_Chart_Legend::xlLegendPositionCustom, - PHPExcel_Chart_Legend::xlLegendPositionLeft, - PHPExcel_Chart_Legend::xlLegendPositionRight, - PHPExcel_Chart_Legend::xlLegendPositionTop, + \PHPExcel\Chart\Legend::xlLegendPositionBottom, + \PHPExcel\Chart\Legend::xlLegendPositionCorner, + \PHPExcel\Chart\Legend::xlLegendPositionCustom, + \PHPExcel\Chart\Legend::xlLegendPositionLeft, + \PHPExcel\Chart\Legend::xlLegendPositionRight, + \PHPExcel\Chart\Legend::xlLegendPositionTop, ); - $testInstance = new PHPExcel_Chart_Legend; + $testInstance = new \PHPExcel\Chart\Legend; foreach ($positionValues as $positionValue) { $result = $testInstance->setPositionXL($positionValue); @@ -73,20 +64,20 @@ class LegendTest extends PHPUnit_Framework_TestCase public function testSetInvalidXLPositionReturnsFalse() { - $testInstance = new PHPExcel_Chart_Legend; + $testInstance = new \PHPExcel\Chart\Legend; $result = $testInstance->setPositionXL(999); $this->assertFalse($result); // Ensure that value is unchanged $result = $testInstance->getPositionXL(); - $this->assertEquals(PHPExcel_Chart_Legend::xlLegendPositionRight, $result); + $this->assertEquals(\PHPExcel\Chart\Legend::xlLegendPositionRight, $result); } 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); $result = $testInstance->getPositionXL(); @@ -100,7 +91,7 @@ class LegendTest extends PHPUnit_Framework_TestCase false, ); - $testInstance = new PHPExcel_Chart_Legend; + $testInstance = new \PHPExcel\Chart\Legend; foreach ($overlayValues as $overlayValue) { $result = $testInstance->setOverlay($overlayValue); @@ -110,7 +101,7 @@ class LegendTest extends PHPUnit_Framework_TestCase public function testSetInvalidOverlayReturnsFalse() { - $testInstance = new PHPExcel_Chart_Legend; + $testInstance = new \PHPExcel\Chart\Legend; $result = $testInstance->setOverlay('INVALID'); $this->assertFalse($result); @@ -123,7 +114,7 @@ class LegendTest extends PHPUnit_Framework_TestCase { $OverlayValue = true; - $testInstance = new PHPExcel_Chart_Legend; + $testInstance = new \PHPExcel\Chart\Legend; $setValue = $testInstance->setOverlay($OverlayValue); $result = $testInstance->getOverlay(); diff --git a/unitTests/Classes/src/Reader/XEEValidatorTest.php b/unitTests/Classes/src/Reader/XEEValidatorTest.php index 49e4aa98..a033bdfb 100644 --- a/unitTests/Classes/src/Reader/XEEValidatorTest.php +++ b/unitTests/Classes/src/Reader/XEEValidatorTest.php @@ -3,15 +3,6 @@ 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 * @expectedException PHPExcel_Reader_Exception diff --git a/unitTests/Classes/src/Shared/CodePageTest.php b/unitTests/Classes/src/Shared/CodePageTest.php index d434694e..7d261bc3 100644 --- a/unitTests/Classes/src/Shared/CodePageTest.php +++ b/unitTests/Classes/src/Shared/CodePageTest.php @@ -5,15 +5,6 @@ require_once 'testDataFileIterator.php'; 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 */ diff --git a/unitTests/Classes/src/Shared/DateTest.php b/unitTests/Classes/src/Shared/DateTest.php index f0bf9198..c8649738 100644 --- a/unitTests/Classes/src/Shared/DateTest.php +++ b/unitTests/Classes/src/Shared/DateTest.php @@ -5,24 +5,15 @@ require_once 'testDataFileIterator.php'; 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() { $calendarValues = array( - PHPExcel_Shared_Date::CALENDAR_MAC_1904, - PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900, + \PHPExcel\Shared\Date::CALENDAR_MAC_1904, + \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900, ); 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); } } @@ -30,7 +21,7 @@ class DateTest extends PHPUnit_Framework_TestCase public function testSetExcelCalendarWithInvalidValue() { $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); } @@ -40,8 +31,8 @@ class DateTest extends PHPUnit_Framework_TestCase public function testDateTimeExcelToPHP1900() { $result = call_user_func( - array('PHPExcel_Shared_Date','setExcelCalendar'), - PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900 + array('\PHPExcel\Shared\Date','setExcelCalendar'), + \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900 ); $args = func_get_args(); @@ -49,7 +40,7 @@ class DateTest extends PHPUnit_Framework_TestCase if ($args[0] < 1) { $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); } @@ -64,13 +55,13 @@ class DateTest extends PHPUnit_Framework_TestCase public function testDateTimePHPToExcel1900() { $result = call_user_func( - array('PHPExcel_Shared_Date','setExcelCalendar'), - PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900 + array('\PHPExcel\Shared\Date','setExcelCalendar'), + \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900 ); $args = func_get_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); } @@ -85,13 +76,13 @@ class DateTest extends PHPUnit_Framework_TestCase public function testDateTimeFormattedPHPToExcel1900() { $result = call_user_func( - array('PHPExcel_Shared_Date','setExcelCalendar'), - PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900 + array('\PHPExcel\Shared\Date','setExcelCalendar'), + \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900 ); $args = func_get_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); } @@ -106,8 +97,8 @@ class DateTest extends PHPUnit_Framework_TestCase public function testDateTimeExcelToPHP1904() { $result = call_user_func( - array('PHPExcel_Shared_Date','setExcelCalendar'), - PHPExcel_Shared_Date::CALENDAR_MAC_1904 + array('\PHPExcel\Shared\Date','setExcelCalendar'), + \PHPExcel\Shared\Date::CALENDAR_MAC_1904 ); $args = func_get_args(); @@ -115,7 +106,7 @@ class DateTest extends PHPUnit_Framework_TestCase if ($args[0] < 1) { $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); } @@ -130,13 +121,13 @@ class DateTest extends PHPUnit_Framework_TestCase public function testDateTimePHPToExcel1904() { $result = call_user_func( - array('PHPExcel_Shared_Date','setExcelCalendar'), - PHPExcel_Shared_Date::CALENDAR_MAC_1904 + array('\PHPExcel\Shared\Date','setExcelCalendar'), + \PHPExcel\Shared\Date::CALENDAR_MAC_1904 ); $args = func_get_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); } @@ -152,7 +143,7 @@ class DateTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -167,8 +158,8 @@ class DateTest extends PHPUnit_Framework_TestCase public function testDateTimeExcelToPHP1900Timezone() { $result = call_user_func( - array('PHPExcel_Shared_Date','setExcelCalendar'), - PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900 + array('\PHPExcel\Shared\Date','setExcelCalendar'), + \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900 ); $args = func_get_args(); @@ -176,7 +167,7 @@ class DateTest extends PHPUnit_Framework_TestCase if ($args[0] < 1) { $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); } diff --git a/unitTests/Classes/src/Shared/FileTest.php b/unitTests/Classes/src/Shared/FileTest.php index 6f6696c5..06ede7e8 100644 --- a/unitTests/Classes/src/Shared/FileTest.php +++ b/unitTests/Classes/src/Shared/FileTest.php @@ -5,15 +5,6 @@ require_once 'testDataFileIterator.php'; 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() { $expectedResult = false; diff --git a/unitTests/Classes/src/Shared/FontTest.php b/unitTests/Classes/src/Shared/FontTest.php index eecd69de..1f1fe2f0 100644 --- a/unitTests/Classes/src/Shared/FontTest.php +++ b/unitTests/Classes/src/Shared/FontTest.php @@ -5,32 +5,23 @@ require_once 'testDataFileIterator.php'; 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() { - $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); } public function testSetAutoSizeMethod() { $autosizeMethodValues = array( - PHPExcel_Shared_Font::AUTOSIZE_METHOD_EXACT, - PHPExcel_Shared_Font::AUTOSIZE_METHOD_APPROX, + \PHPExcel\Shared\Font::AUTOSIZE_METHOD_EXACT, + \PHPExcel\Shared\Font::AUTOSIZE_METHOD_APPROX, ); 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); } } @@ -39,7 +30,7 @@ class FontTest extends PHPUnit_Framework_TestCase { $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); } @@ -50,7 +41,7 @@ class FontTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -66,7 +57,7 @@ class FontTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } @@ -82,7 +73,7 @@ class FontTest extends PHPUnit_Framework_TestCase { $args = func_get_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); } diff --git a/unitTests/Classes/src/Shared/PasswordHasherTest.php b/unitTests/Classes/src/Shared/PasswordHasherTest.php index 620acb98..a86a1ee5 100644 --- a/unitTests/Classes/src/Shared/PasswordHasherTest.php +++ b/unitTests/Classes/src/Shared/PasswordHasherTest.php @@ -5,15 +5,6 @@ require_once 'testDataFileIterator.php'; 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 */ diff --git a/unitTests/Classes/src/Shared/StringTest.php b/unitTests/Classes/src/Shared/StringTest.php index 9955d816..5df90ea8 100644 --- a/unitTests/Classes/src/Shared/StringTest.php +++ b/unitTests/Classes/src/Shared/StringTest.php @@ -5,24 +5,15 @@ require_once 'testDataFileIterator.php'; 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() { - $result = call_user_func(array('PHPExcel_Shared_String','getIsMbstringEnabled')); + $result = call_user_func(array('\PHPExcel\Shared\String','getIsMbstringEnabled')); $this->assertTrue($result); } public function testGetIsIconvEnabled() { - $result = call_user_func(array('PHPExcel_Shared_String','getIsIconvEnabled')); + $result = call_user_func(array('\PHPExcel\Shared\String','getIsIconvEnabled')); $this->assertTrue($result); } @@ -31,16 +22,16 @@ class StringTest extends PHPUnit_Framework_TestCase $localeconv = localeconv(); $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); } public function testSetDecimalSeparator() { $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); } @@ -49,16 +40,16 @@ class StringTest extends PHPUnit_Framework_TestCase $localeconv = localeconv(); $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); } public function testSetThousandsSeparator() { $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); } @@ -67,16 +58,16 @@ class StringTest extends PHPUnit_Framework_TestCase $localeconv = localeconv(); $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); } public function testSetCurrencyCode() { $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); } } diff --git a/unitTests/Classes/src/Shared/TimeZoneTest.php b/unitTests/Classes/src/Shared/TimeZoneTest.php index 25484267..40edf950 100644 --- a/unitTests/Classes/src/Shared/TimeZoneTest.php +++ b/unitTests/Classes/src/Shared/TimeZoneTest.php @@ -3,15 +3,6 @@ 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() { $timezoneValues = array( @@ -23,7 +14,7 @@ class TimeZoneTest extends PHPUnit_Framework_TestCase ); 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); } @@ -32,7 +23,7 @@ class TimeZoneTest extends PHPUnit_Framework_TestCase public function testSetTimezoneWithInvalidValue() { $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); } } diff --git a/unitTests/Classes/src/Style/ColorTest.php b/unitTests/Classes/src/Style/ColorTest.php index 83427b10..c590260e 100644 --- a/unitTests/Classes/src/Style/ColorTest.php +++ b/unitTests/Classes/src/Style/ColorTest.php @@ -5,15 +5,6 @@ require_once 'testDataFileIteratorJson.php'; 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 */ diff --git a/unitTests/Classes/src/Style/NumberFormatDateTest.php b/unitTests/Classes/src/Style/NumberFormatDateTest.php index 8ba828f7..da36aee6 100644 --- a/unitTests/Classes/src/Style/NumberFormatDateTest.php +++ b/unitTests/Classes/src/Style/NumberFormatDateTest.php @@ -8,13 +8,8 @@ class NumberFormatDateTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - PHPExcel_Shared_String::setDecimalSeparator('.'); - PHPExcel_Shared_String::setThousandsSeparator(','); + \PHPExcel\Shared\String::setDecimalSeparator('.'); + \PHPExcel\Shared\String::setThousandsSeparator(','); } /** diff --git a/unitTests/Classes/src/Style/NumberFormatTest.php b/unitTests/Classes/src/Style/NumberFormatTest.php index 08c2f024..170ff868 100644 --- a/unitTests/Classes/src/Style/NumberFormatTest.php +++ b/unitTests/Classes/src/Style/NumberFormatTest.php @@ -8,13 +8,8 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - PHPExcel_Shared_String::setDecimalSeparator('.'); - PHPExcel_Shared_String::setThousandsSeparator(','); + \PHPExcel\Shared\String::setDecimalSeparator('.'); + \PHPExcel\Shared\String::setThousandsSeparator(','); } /** diff --git a/unitTests/Classes/src/Worksheet/AutoFilter/Column/RuleTest.php b/unitTests/Classes/src/Worksheet/AutoFilter/Column/RuleTest.php index 0c39c683..ffeaa85e 100644 --- a/unitTests/Classes/src/Worksheet/AutoFilter/Column/RuleTest.php +++ b/unitTests/Classes/src/Worksheet/AutoFilter/Column/RuleTest.php @@ -9,12 +9,7 @@ class RuleTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - $this->_mockAutoFilterColumnObject = $this->getMockBuilder('PHPExcel_Worksheet_AutoFilter_Column') + $this->_mockAutoFilterColumnObject = $this->getMockBuilder('\PHPExcel\Worksheet\AutoFilter\Column') ->disableOriginalConstructor() ->getMock(); @@ -22,7 +17,7 @@ class RuleTest extends PHPUnit_Framework_TestCase ->method('testColumnInRange') ->will($this->returnValue(3)); - $this->_testAutoFilterRuleObject = new PHPExcel_Worksheet_AutoFilter_Column_Rule( + $this->_testAutoFilterRuleObject = new \PHPExcel\Worksheet\AutoFilter\Column\Rule( $this->_mockAutoFilterColumnObject ); } @@ -30,16 +25,16 @@ class RuleTest extends PHPUnit_Framework_TestCase public function testGetRuleType() { $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() { - $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 $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(); $this->assertEquals($expectedResult, $result); @@ -51,7 +46,7 @@ class RuleTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $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(); $this->assertEquals($expectedResult, $result); @@ -60,16 +55,16 @@ class RuleTest extends PHPUnit_Framework_TestCase public function testGetOperator() { $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() { - $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 $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(); $this->assertEquals($expectedResult, $result); @@ -77,11 +72,11 @@ class RuleTest extends PHPUnit_Framework_TestCase 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 $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(); $this->assertEquals($expectedResult, $result); @@ -90,19 +85,19 @@ class RuleTest extends PHPUnit_Framework_TestCase public function testGetParent() { $result = $this->_testAutoFilterRuleObject->getParent(); - $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); + $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result); } public function testSetParent() { // Setters return the instance to implement the fluent interface $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() { $result = clone $this->_testAutoFilterRuleObject; - $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result); + $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column\Rule', $result); } } diff --git a/unitTests/Classes/src/Worksheet/AutoFilter/ColumnTest.php b/unitTests/Classes/src/Worksheet/AutoFilter/ColumnTest.php index da6eef53..0a8b4461 100644 --- a/unitTests/Classes/src/Worksheet/AutoFilter/ColumnTest.php +++ b/unitTests/Classes/src/Worksheet/AutoFilter/ColumnTest.php @@ -11,12 +11,7 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - $this->_mockAutoFilterObject = $this->getMockBuilder('PHPExcel_Worksheet_AutoFilter') + $this->_mockAutoFilterObject = $this->getMockBuilder('\PHPExcel\Worksheet\AutoFilter') ->disableOriginalConstructor() ->getMock(); @@ -24,7 +19,7 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase ->method('testColumnInRange') ->will($this->returnValue(3)); - $this->_testAutoFilterColumnObject = new PHPExcel_Worksheet_AutoFilter_Column( + $this->_testAutoFilterColumnObject = new \PHPExcel\Worksheet\AutoFilter\Column( $this->_testInitialColumn, $this->_mockAutoFilterObject ); @@ -42,7 +37,7 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $result = $this->_testAutoFilterColumnObject->setColumnIndex($expectedResult); - $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); + $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result); $result = $this->_testAutoFilterColumnObject->getColumnIndex(); $this->assertEquals($expectedResult, $result); @@ -51,29 +46,29 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase public function testGetParent() { $result = $this->_testAutoFilterColumnObject->getParent(); - $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result); + $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter', $result); } public function testSetParent() { // Setters return the instance to implement the fluent interface $result = $this->_testAutoFilterColumnObject->setParent($this->_mockAutoFilterObject); - $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); + $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result); } public function testGetFilterType() { $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() { - $result = $this->_testAutoFilterColumnObject->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); - $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); + $result = $this->_testAutoFilterColumnObject->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); + $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result); $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() { $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() { - $result = $this->_testAutoFilterColumnObject->setJoin(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND); - $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); + $result = $this->_testAutoFilterColumnObject->setJoin(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND); + $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result); $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 $result = $this->_testAutoFilterColumnObject->setAttributes($attributeSet); - $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); + $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result); } public function testGetAttributes() @@ -144,7 +139,7 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase foreach ($attributeSet as $attributeName => $attributeValue) { // Setters return the instance to implement the fluent interface $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() { $result = clone $this->_testAutoFilterColumnObject; - $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result); + $this->assertInstanceOf('\PHPExcel\Worksheet\AutoFilter\Column', $result); } } diff --git a/unitTests/Classes/src/Worksheet/CellCollectionTest.php b/unitTests/Classes/src/Worksheet/CellCollectionTest.php index 4e489c28..1b71933b 100644 --- a/unitTests/Classes/src/Worksheet/CellCollectionTest.php +++ b/unitTests/Classes/src/Worksheet/CellCollectionTest.php @@ -14,7 +14,7 @@ class CellCollectionTest extends \PHPUnit_Framework_TestCase $methods = \PHPExcel\CachedObjectStorageFactory::getCacheStorageMethods(); foreach ($methods as $method) { \PHPExcel\CachedObjectStorageFactory::initialize($method); - $workbook = new \PHPExcel(); + $workbook = new \PHPExcel\Spreadsheet(); $cells = ['A1', 'A2']; $worksheet = $workbook->getActiveSheet(); $worksheet->setCellValue('A1', 1); diff --git a/unitTests/Classes/src/Worksheet/RowCellIteratorTest.php b/unitTests/Classes/src/Worksheet/RowCellIteratorTest.php index ec60e90b..3eeb0ac2 100644 --- a/unitTests/Classes/src/Worksheet/RowCellIteratorTest.php +++ b/unitTests/Classes/src/Worksheet/RowCellIteratorTest.php @@ -7,16 +7,11 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase 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') ->disableOriginalConstructor() ->getMock(); - $this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet') + $this->mockWorksheet = $this->getMockBuilder('\PHPExcel\Worksheet') ->disableOriginalConstructor() ->getMock(); @@ -31,7 +26,7 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase public function testIteratorFullRange() { - $iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet); + $iterator = new \PHPExcel\Worksheet\RowCellIterator($this->mockWorksheet); $RowCellIndexResult = 'A'; $this->assertEquals($RowCellIndexResult, $iterator->key()); @@ -43,7 +38,7 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase 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'; $this->assertEquals($RowCellIndexResult, $iterator->key()); @@ -56,7 +51,7 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase public function testIteratorSeekAndPrev() { $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'; $iterator->seek('D'); $this->assertEquals($RowCellIndexResult, $iterator->key()); @@ -73,7 +68,7 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase */ 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); } @@ -82,7 +77,7 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase */ 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(); } } diff --git a/unitTests/Classes/src/Worksheet/RowIteratorTest.php b/unitTests/Classes/src/Worksheet/RowIteratorTest.php index ec0b2796..c02b0632 100644 --- a/unitTests/Classes/src/Worksheet/RowIteratorTest.php +++ b/unitTests/Classes/src/Worksheet/RowIteratorTest.php @@ -7,16 +7,11 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - $this->mockRow = $this->getMockBuilder('PHPExcel_Worksheet_Row') + $this->mockRow = $this->getMockBuilder('\PHPExcel\Worksheet\Row') ->disableOriginalConstructor() ->getMock(); - $this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet') + $this->mockWorksheet = $this->getMockBuilder('\PHPExcel\Worksheet') ->disableOriginalConstructor() ->getMock(); @@ -31,31 +26,31 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase public function testIteratorFullRange() { - $iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet); + $iterator = new \PHPExcel\Worksheet\RowIterator($this->mockWorksheet); $rowIndexResult = 1; $this->assertEquals($rowIndexResult, $iterator->key()); foreach ($iterator as $key => $row) { $this->assertEquals($rowIndexResult++, $key); - $this->assertInstanceOf('PHPExcel_Worksheet_Row', $row); + $this->assertInstanceOf('\PHPExcel\Worksheet\Row', $row); } } public function testIteratorStartEndRange() { - $iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4); + $iterator = new \PHPExcel\Worksheet\RowIterator($this->mockWorksheet, 2, 4); $rowIndexResult = 2; $this->assertEquals($rowIndexResult, $iterator->key()); foreach ($iterator as $key => $row) { $this->assertEquals($rowIndexResult++, $key); - $this->assertInstanceOf('PHPExcel_Worksheet_Row', $row); + $this->assertInstanceOf('\PHPExcel\Worksheet\Row', $row); } } public function testIteratorSeekAndPrev() { - $iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4); + $iterator = new \PHPExcel\Worksheet\RowIterator($this->mockWorksheet, 2, 4); $columnIndexResult = 4; $iterator->seek(4); $this->assertEquals($columnIndexResult, $iterator->key()); @@ -71,7 +66,7 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase */ public function testSeekOutOfRange() { - $iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4); + $iterator = new \PHPExcel\Worksheet\RowIterator($this->mockWorksheet, 2, 4); $iterator->seek(1); } @@ -80,7 +75,7 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase */ public function testPrevOutOfRange() { - $iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4); + $iterator = new \PHPExcel\Worksheet\RowIterator($this->mockWorksheet, 2, 4); $iterator->prev(); } } diff --git a/unitTests/Classes/src/Worksheet/WorksheetColumnTest.php b/unitTests/Classes/src/Worksheet/WorksheetColumnTest.php index 9e880fb9..78d9cecf 100644 --- a/unitTests/Classes/src/Worksheet/WorksheetColumnTest.php +++ b/unitTests/Classes/src/Worksheet/WorksheetColumnTest.php @@ -7,12 +7,7 @@ class WorksheetColumnTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - $this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet') + $this->mockWorksheet = $this->getMockBuilder('\PHPExcel\Worksheet') ->disableOriginalConstructor() ->getMock(); $this->mockWorksheet->expects($this->any()) @@ -23,24 +18,24 @@ class WorksheetColumnTest extends PHPUnit_Framework_TestCase public function testInstantiateColumnDefault() { - $column = new PHPExcel_Worksheet_Column($this->mockWorksheet); - $this->assertInstanceOf('PHPExcel_Worksheet_Column', $column); + $column = new \PHPExcel\Worksheet\Column($this->mockWorksheet); + $this->assertInstanceOf('\PHPExcel\Worksheet\Column', $column); $columnIndex = $column->getColumnIndex(); $this->assertEquals('A', $columnIndex); } public function testInstantiateColumnSpecified() { - $column = new PHPExcel_Worksheet_Column($this->mockWorksheet, 'E'); - $this->assertInstanceOf('PHPExcel_Worksheet_Column', $column); + $column = new \PHPExcel\Worksheet\Column($this->mockWorksheet, 'E'); + $this->assertInstanceOf('\PHPExcel\Worksheet\Column', $column); $columnIndex = $column->getColumnIndex(); $this->assertEquals('E', $columnIndex); } public function testGetCellIterator() { - $column = new PHPExcel_Worksheet_Column($this->mockWorksheet); + $column = new \PHPExcel\Worksheet\Column($this->mockWorksheet); $cellIterator = $column->getCellIterator(); - $this->assertInstanceOf('PHPExcel_Worksheet_ColumnCellIterator', $cellIterator); + $this->assertInstanceOf('\PHPExcel\Worksheet\ColumnCellIterator', $cellIterator); } } diff --git a/unitTests/Classes/src/Worksheet/WorksheetRowTest.php b/unitTests/Classes/src/Worksheet/WorksheetRowTest.php index 059d8b20..0617a6c7 100644 --- a/unitTests/Classes/src/Worksheet/WorksheetRowTest.php +++ b/unitTests/Classes/src/Worksheet/WorksheetRowTest.php @@ -7,12 +7,7 @@ class WorksheetRowTest extends PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); - } - require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); - - $this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet') + $this->mockWorksheet = $this->getMockBuilder('\PHPExcel\Worksheet') ->disableOriginalConstructor() ->getMock(); $this->mockWorksheet->expects($this->any()) @@ -23,24 +18,24 @@ class WorksheetRowTest extends PHPUnit_Framework_TestCase public function testInstantiateRowDefault() { - $row = new PHPExcel_Worksheet_Row($this->mockWorksheet); - $this->assertInstanceOf('PHPExcel_Worksheet_Row', $row); + $row = new \PHPExcel\Worksheet\Row($this->mockWorksheet); + $this->assertInstanceOf('\PHPExcel\Worksheet\Row', $row); $rowIndex = $row->getRowIndex(); $this->assertEquals(1, $rowIndex); } public function testInstantiateRowSpecified() { - $row = new PHPExcel_Worksheet_Row($this->mockWorksheet, 5); - $this->assertInstanceOf('PHPExcel_Worksheet_Row', $row); + $row = new \PHPExcel\Worksheet\Row($this->mockWorksheet, 5); + $this->assertInstanceOf('\PHPExcel\Worksheet\Row', $row); $rowIndex = $row->getRowIndex(); $this->assertEquals(5, $rowIndex); } public function testGetCellIterator() { - $row = new PHPExcel_Worksheet_Row($this->mockWorksheet); + $row = new \PHPExcel\Worksheet\Row($this->mockWorksheet); $cellIterator = $row->getCellIterator(); - $this->assertInstanceOf('PHPExcel_Worksheet_RowCellIterator', $cellIterator); + $this->assertInstanceOf('\PHPExcel\Worksheet\RowCellIterator', $cellIterator); } }