From aef4d711f5cb310e7d4c395acd31683a5237f3c1 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Wed, 20 Sep 2017 14:55:42 +0900 Subject: [PATCH] Use `self::assert*()` instead of `$this->assert*()` Because even if it doesn't make a difference in practice, it is technically more correct to call static methods statically. It also better advertise that those methods can be used from any context. --- .../Calculation/DateTimeTest.php | 90 ++++++++-------- .../Calculation/EngineeringTest.php | 86 +++++++-------- .../Calculation/FinancialTest.php | 62 +++++------ .../Calculation/FunctionsTest.php | 42 ++++---- .../Calculation/LogicalTest.php | 14 +-- .../Calculation/LookupRefTest.php | 6 +- .../Calculation/MathTrigTest.php | 60 +++++------ .../Calculation/TextDataTest.php | 42 ++++---- tests/PhpSpreadsheetTests/CalculationTest.php | 16 +-- .../Cell/AdvancedValueBinderTest.php | 2 +- .../PhpSpreadsheetTests/Cell/DataTypeTest.php | 6 +- .../Cell/DefaultValueBinderTest.php | 6 +- .../Cell/HyperlinkTest.php | 18 ++-- tests/PhpSpreadsheetTests/CellTest.php | 54 +++++----- .../Chart/DataSeriesValuesTest.php | 6 +- .../PhpSpreadsheetTests/Chart/LayoutTest.php | 4 +- .../PhpSpreadsheetTests/Chart/LegendTest.php | 24 ++--- .../Collection/CellsTest.php | 48 ++++----- .../Helper/MigratorTest.php | 2 +- tests/PhpSpreadsheetTests/IOFactoryTest.php | 2 +- tests/PhpSpreadsheetTests/Reader/CsvTest.php | 8 +- tests/PhpSpreadsheetTests/Reader/HTMLTest.php | 2 +- tests/PhpSpreadsheetTests/Reader/OdsTest.php | 102 +++++++++--------- .../Reader/XEEValidatorTest.php | 4 +- .../ReferenceHelperTest.php | 4 +- tests/PhpSpreadsheetTests/SettingsTest.php | 8 +- .../Shared/CodePageTest.php | 6 +- tests/PhpSpreadsheetTests/Shared/DateTest.php | 20 ++-- tests/PhpSpreadsheetTests/Shared/FileTest.php | 4 +- tests/PhpSpreadsheetTests/Shared/FontTest.php | 12 +-- .../Shared/PasswordHasherTest.php | 2 +- .../Shared/StringHelperTest.php | 20 ++-- .../Shared/TimeZoneTest.php | 4 +- .../PhpSpreadsheetTests/Style/BorderTest.php | 4 +- tests/PhpSpreadsheetTests/Style/ColorTest.php | 8 +- .../Style/NumberFormatDateTest.php | 2 +- .../Style/NumberFormatTest.php | 2 +- .../Worksheet/AutoFilter/Column/RuleTest.php | 26 ++--- .../Worksheet/AutoFilter/ColumnTest.php | 44 ++++---- .../Worksheet/AutoFilterTest.php | 76 ++++++------- .../Worksheet/ColumnCellIteratorTest.php | 16 +-- .../Worksheet/ColumnIteratorTest.php | 16 +-- .../Worksheet/RowCellIteratorTest.php | 16 +-- .../Worksheet/RowIteratorTest.php | 16 +-- .../Worksheet/WorksheetColumnTest.php | 10 +- .../Worksheet/WorksheetRowTest.php | 10 +- tests/PhpSpreadsheetTests/WorksheetTest.php | 16 +-- .../Writer/Ods/ContentTest.php | 4 +- .../Writer/Xls/WorkbookTest.php | 2 +- 49 files changed, 527 insertions(+), 527 deletions(-) diff --git a/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php b/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php index 6b05d454..8959cb00 100644 --- a/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php @@ -25,7 +25,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testDATE($expectedResult, ...$args) { $result = DateTime::DATE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerDATE() @@ -38,7 +38,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase Functions::setReturnDateType(Functions::RETURNDATE_PHP_NUMERIC); $result = DateTime::DATE(2012, 1, 31); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); - $this->assertEquals(1327968000, $result, null, 1E-8); + self::assertEquals(1327968000, $result, null, 1E-8); } public function testDATEtoPHPObject() @@ -47,11 +47,11 @@ class DateTimeTest extends PHPUnit_Framework_TestCase $result = DateTime::DATE(2012, 1, 31); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); // Must return an object... - $this->assertInternalType('object', $result); + self::assertInternalType('object', $result); // ... of the correct type - $this->assertTrue(is_a($result, 'DateTime')); + self::assertTrue(is_a($result, 'DateTime')); // ... with the correct value - $this->assertEquals($result->format('d-M-Y'), '31-Jan-2012'); + self::assertEquals($result->format('d-M-Y'), '31-Jan-2012'); } public function testDATEwith1904Calendar() @@ -59,7 +59,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase Date::setExcelCalendar(Date::CALENDAR_MAC_1904); $result = DateTime::DATE(1918, 11, 11); Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900); - $this->assertEquals($result, 5428); + self::assertEquals($result, 5428); } public function testDATEwith1904CalendarError() @@ -67,7 +67,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase Date::setExcelCalendar(Date::CALENDAR_MAC_1904); $result = DateTime::DATE(1901, 1, 31); Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900); - $this->assertEquals($result, '#NUM!'); + self::assertEquals($result, '#NUM!'); } /** @@ -78,7 +78,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testDATEVALUE($expectedResult, ...$args) { $result = DateTime::DATEVALUE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerDATEVALUE() @@ -91,7 +91,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase Functions::setReturnDateType(Functions::RETURNDATE_PHP_NUMERIC); $result = DateTime::DATEVALUE('2012-1-31'); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); - $this->assertEquals(1327968000, $result, null, 1E-8); + self::assertEquals(1327968000, $result, null, 1E-8); } public function testDATEVALUEtoPHPObject() @@ -100,11 +100,11 @@ class DateTimeTest extends PHPUnit_Framework_TestCase $result = DateTime::DATEVALUE('2012-1-31'); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); // Must return an object... - $this->assertInternalType('object', $result); + self::assertInternalType('object', $result); // ... of the correct type - $this->assertTrue(is_a($result, 'DateTime')); + self::assertTrue(is_a($result, 'DateTime')); // ... with the correct value - $this->assertEquals($result->format('d-M-Y'), '31-Jan-2012'); + self::assertEquals($result->format('d-M-Y'), '31-Jan-2012'); } /** @@ -115,7 +115,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testYEAR($expectedResult, ...$args) { $result = DateTime::YEAR(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerYEAR() @@ -131,7 +131,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testMONTH($expectedResult, ...$args) { $result = DateTime::MONTHOFYEAR(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerMONTH() @@ -147,7 +147,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testWEEKNUM($expectedResult, ...$args) { $result = DateTime::WEEKNUM(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerWEEKNUM() @@ -163,7 +163,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testWEEKDAY($expectedResult, ...$args) { $result = DateTime::WEEKDAY(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerWEEKDAY() @@ -179,7 +179,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testDAY($expectedResult, ...$args) { $result = DateTime::DAYOFMONTH(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerDAY() @@ -195,7 +195,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testTIME($expectedResult, ...$args) { $result = DateTime::TIME(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerTIME() @@ -208,7 +208,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase Functions::setReturnDateType(Functions::RETURNDATE_PHP_NUMERIC); $result = DateTime::TIME(7, 30, 20); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); - $this->assertEquals(27020, $result, null, 1E-8); + self::assertEquals(27020, $result, null, 1E-8); } public function testTIMEtoPHPObject() @@ -217,11 +217,11 @@ class DateTimeTest extends PHPUnit_Framework_TestCase $result = DateTime::TIME(7, 30, 20); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); // Must return an object... - $this->assertInternalType('object', $result); + self::assertInternalType('object', $result); // ... of the correct type - $this->assertTrue(is_a($result, 'DateTime')); + self::assertTrue(is_a($result, 'DateTime')); // ... with the correct value - $this->assertEquals($result->format('H:i:s'), '07:30:20'); + self::assertEquals($result->format('H:i:s'), '07:30:20'); } /** @@ -232,7 +232,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testTIMEVALUE($expectedResult, ...$args) { $result = DateTime::TIMEVALUE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerTIMEVALUE() @@ -245,7 +245,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase Functions::setReturnDateType(Functions::RETURNDATE_PHP_NUMERIC); $result = DateTime::TIMEVALUE('7:30:20'); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); - $this->assertEquals(23420, $result, null, 1E-8); + self::assertEquals(23420, $result, null, 1E-8); } public function testTIMEVALUEtoPHPObject() @@ -254,11 +254,11 @@ class DateTimeTest extends PHPUnit_Framework_TestCase $result = DateTime::TIMEVALUE('7:30:20'); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); // Must return an object... - $this->assertInternalType('object', $result); + self::assertInternalType('object', $result); // ... of the correct type - $this->assertTrue(is_a($result, 'DateTime')); + self::assertTrue(is_a($result, 'DateTime')); // ... with the correct value - $this->assertEquals($result->format('H:i:s'), '07:30:20'); + self::assertEquals($result->format('H:i:s'), '07:30:20'); } /** @@ -269,7 +269,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testHOUR($expectedResult, ...$args) { $result = DateTime::HOUROFDAY(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerHOUR() @@ -285,7 +285,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testMINUTE($expectedResult, ...$args) { $result = DateTime::MINUTE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerMINUTE() @@ -301,7 +301,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testSECOND($expectedResult, ...$args) { $result = DateTime::SECOND(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerSECOND() @@ -317,7 +317,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testNETWORKDAYS($expectedResult, ...$args) { $result = DateTime::NETWORKDAYS(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerNETWORKDAYS() @@ -333,7 +333,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testWORKDAY($expectedResult, ...$args) { $result = DateTime::WORKDAY(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerWORKDAY() @@ -349,7 +349,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testEDATE($expectedResult, ...$args) { $result = DateTime::EDATE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerEDATE() @@ -362,7 +362,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase Functions::setReturnDateType(Functions::RETURNDATE_PHP_NUMERIC); $result = DateTime::EDATE('2012-1-26', -1); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); - $this->assertEquals(1324857600, $result, null, 1E-8); + self::assertEquals(1324857600, $result, null, 1E-8); } public function testEDATEtoPHPObject() @@ -371,11 +371,11 @@ class DateTimeTest extends PHPUnit_Framework_TestCase $result = DateTime::EDATE('2012-1-26', -1); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); // Must return an object... - $this->assertInternalType('object', $result); + self::assertInternalType('object', $result); // ... of the correct type - $this->assertTrue(is_a($result, 'DateTime')); + self::assertTrue(is_a($result, 'DateTime')); // ... with the correct value - $this->assertEquals($result->format('d-M-Y'), '26-Dec-2011'); + self::assertEquals($result->format('d-M-Y'), '26-Dec-2011'); } /** @@ -386,7 +386,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testEOMONTH($expectedResult, ...$args) { $result = DateTime::EOMONTH(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerEOMONTH() @@ -399,7 +399,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase Functions::setReturnDateType(Functions::RETURNDATE_PHP_NUMERIC); $result = DateTime::EOMONTH('2012-1-26', -1); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); - $this->assertEquals(1325289600, $result, null, 1E-8); + self::assertEquals(1325289600, $result, null, 1E-8); } public function testEOMONTHtoPHPObject() @@ -408,11 +408,11 @@ class DateTimeTest extends PHPUnit_Framework_TestCase $result = DateTime::EOMONTH('2012-1-26', -1); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); // Must return an object... - $this->assertInternalType('object', $result); + self::assertInternalType('object', $result); // ... of the correct type - $this->assertTrue(is_a($result, 'DateTime')); + self::assertTrue(is_a($result, 'DateTime')); // ... with the correct value - $this->assertEquals($result->format('d-M-Y'), '31-Dec-2011'); + self::assertEquals($result->format('d-M-Y'), '31-Dec-2011'); } /** @@ -423,7 +423,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testDATEDIF($expectedResult, ...$args) { $result = DateTime::DATEDIF(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerDATEDIF() @@ -439,7 +439,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testDAYS360($expectedResult, ...$args) { $result = DateTime::DAYS360(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerDAYS360() @@ -455,7 +455,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase public function testYEARFRAC($expectedResult, ...$args) { $result = DateTime::YEARFRAC(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerYEARFRAC() diff --git a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php index 2e19eff7..eab13cd6 100644 --- a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php @@ -33,7 +33,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testBESSELI($expectedResult, ...$args) { $result = Engineering::BESSELI(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerBESSELI() @@ -49,7 +49,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testBESSELJ($expectedResult, ...$args) { $result = Engineering::BESSELJ(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerBESSELJ() @@ -65,7 +65,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testBESSELK($expectedResult, ...$args) { $result = Engineering::BESSELK(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerBESSELK() @@ -81,7 +81,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testBESSELY($expectedResult, ...$args) { $result = Engineering::BESSELY(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerBESSELY() @@ -97,7 +97,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testCOMPLEX($expectedResult, ...$args) { $result = Engineering::COMPLEX(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerCOMPLEX() @@ -113,7 +113,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMAGINARY($expectedResult, ...$args) { $result = Engineering::IMAGINARY(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIMAGINARY() @@ -129,7 +129,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMREAL($expectedResult, ...$args) { $result = Engineering::IMREAL(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIMREAL() @@ -145,7 +145,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMABS($expectedResult, ...$args) { $result = Engineering::IMABS(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIMABS() @@ -162,7 +162,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMARGUMENT($expectedResult, ...$args) { $result = Engineering::IMARGUMENT(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIMARGUMENT() @@ -178,7 +178,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMCONJUGATE($expectedResult, ...$args) { $result = Engineering::IMCONJUGATE(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMCONJUGATE() @@ -194,7 +194,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMCOS($expectedResult, ...$args) { $result = Engineering::IMCOS(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMCOS() @@ -213,7 +213,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase $this->markTestIncomplete('TODO: This test should be fixed'); $result = Engineering::IMDIV(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMDIV() @@ -229,7 +229,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMEXP($expectedResult, ...$args) { $result = Engineering::IMEXP(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMEXP() @@ -245,7 +245,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMLN($expectedResult, ...$args) { $result = Engineering::IMLN(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMLN() @@ -261,7 +261,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMLOG2($expectedResult, ...$args) { $result = Engineering::IMLOG2(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMLOG2() @@ -277,7 +277,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMLOG10($expectedResult, ...$args) { $result = Engineering::IMLOG10(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMLOG10() @@ -296,7 +296,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase $this->markTestIncomplete('TODO: This test should be fixed'); $result = Engineering::IMPOWER(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMPOWER() @@ -312,7 +312,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMPRODUCT($expectedResult, ...$args) { $result = Engineering::IMPRODUCT(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMPRODUCT() @@ -328,7 +328,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMSIN($expectedResult, ...$args) { $result = Engineering::IMSIN(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMSIN() @@ -344,7 +344,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMSQRT($expectedResult, ...$args) { $result = Engineering::IMSQRT(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMSQRT() @@ -363,7 +363,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase $this->markTestIncomplete('TODO: This test should be fixed'); $result = Engineering::IMSUB(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMSUB() @@ -380,7 +380,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testIMSUM($expectedResult, ...$args) { $result = Engineering::IMSUM(...$args); - $this->assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } public function providerIMSUM() @@ -396,7 +396,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testERF($expectedResult, ...$args) { $result = Engineering::ERF(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerERF() @@ -412,7 +412,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testERFC($expectedResult, ...$args) { $result = Engineering::ERFC(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerERFC() @@ -428,7 +428,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testBIN2DEC($expectedResult, ...$args) { $result = Engineering::BINTODEC(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerBIN2DEC() @@ -444,7 +444,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testBIN2HEX($expectedResult, ...$args) { $result = Engineering::BINTOHEX(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerBIN2HEX() @@ -460,7 +460,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testBIN2OCT($expectedResult, ...$args) { $result = Engineering::BINTOOCT(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerBIN2OCT() @@ -476,7 +476,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testDEC2BIN($expectedResult, ...$args) { $result = Engineering::DECTOBIN(...$args); - $this->assertEquals($expectedResult, $result, null); + self::assertEquals($expectedResult, $result, null); } public function providerDEC2BIN() @@ -492,7 +492,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testDEC2HEX($expectedResult, ...$args) { $result = Engineering::DECTOHEX(...$args); - $this->assertEquals($expectedResult, $result, null); + self::assertEquals($expectedResult, $result, null); } public function providerDEC2HEX() @@ -508,7 +508,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testDEC2OCT($expectedResult, ...$args) { $result = Engineering::DECTOOCT(...$args); - $this->assertEquals($expectedResult, $result, null); + self::assertEquals($expectedResult, $result, null); } public function providerDEC2OCT() @@ -524,7 +524,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testHEX2BIN($expectedResult, ...$args) { $result = Engineering::HEXTOBIN(...$args); - $this->assertEquals($expectedResult, $result, null); + self::assertEquals($expectedResult, $result, null); } public function providerHEX2BIN() @@ -540,7 +540,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testHEX2DEC($expectedResult, ...$args) { $result = Engineering::HEXTODEC(...$args); - $this->assertEquals($expectedResult, $result, null); + self::assertEquals($expectedResult, $result, null); } public function providerHEX2DEC() @@ -556,7 +556,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testHEX2OCT($expectedResult, ...$args) { $result = Engineering::HEXTOOCT(...$args); - $this->assertEquals($expectedResult, $result, null); + self::assertEquals($expectedResult, $result, null); } public function providerHEX2OCT() @@ -572,7 +572,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testOCT2BIN($expectedResult, ...$args) { $result = Engineering::OCTTOBIN(...$args); - $this->assertEquals($expectedResult, $result, null); + self::assertEquals($expectedResult, $result, null); } public function providerOCT2BIN() @@ -588,7 +588,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testOCT2DEC($expectedResult, ...$args) { $result = Engineering::OCTTODEC(...$args); - $this->assertEquals($expectedResult, $result, null); + self::assertEquals($expectedResult, $result, null); } public function providerOCT2DEC() @@ -604,7 +604,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testOCT2HEX($expectedResult, ...$args) { $result = Engineering::OCTTOHEX(...$args); - $this->assertEquals($expectedResult, $result, null); + self::assertEquals($expectedResult, $result, null); } public function providerOCT2HEX() @@ -620,7 +620,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testDELTA($expectedResult, ...$args) { $result = Engineering::DELTA(...$args); - $this->assertEquals($expectedResult, $result, null); + self::assertEquals($expectedResult, $result, null); } public function providerDELTA() @@ -636,7 +636,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testGESTEP($expectedResult, ...$args) { $result = Engineering::GESTEP(...$args); - $this->assertEquals($expectedResult, $result, null); + self::assertEquals($expectedResult, $result, null); } public function providerGESTEP() @@ -647,25 +647,25 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testGetConversionGroups() { $result = Engineering::getConversionGroups(); - $this->assertInternalType('array', $result); + self::assertInternalType('array', $result); } public function testGetConversionGroupUnits() { $result = Engineering::getConversionGroupUnits(); - $this->assertInternalType('array', $result); + self::assertInternalType('array', $result); } public function testGetConversionGroupUnitDetails() { $result = Engineering::getConversionGroupUnitDetails(); - $this->assertInternalType('array', $result); + self::assertInternalType('array', $result); } public function testGetConversionMultipliers() { $result = Engineering::getConversionMultipliers(); - $this->assertInternalType('array', $result); + self::assertInternalType('array', $result); } /** @@ -676,7 +676,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase public function testCONVERTUOM($expectedResult, ...$args) { $result = Engineering::CONVERTUOM(...$args); - $this->assertEquals($expectedResult, $result, null); + self::assertEquals($expectedResult, $result, null); } public function providerCONVERTUOM() diff --git a/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php b/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php index 04f6b4e8..d780e014 100644 --- a/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php @@ -22,7 +22,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testACCRINT($expectedResult, ...$args) { $result = Financial::ACCRINT(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerACCRINT() @@ -38,7 +38,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testACCRINTM($expectedResult, ...$args) { $result = Financial::ACCRINTM(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerACCRINTM() @@ -54,7 +54,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testAMORDEGRC($expectedResult, ...$args) { $result = Financial::AMORDEGRC(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerAMORDEGRC() @@ -70,7 +70,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testAMORLINC($expectedResult, ...$args) { $result = Financial::AMORLINC(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerAMORLINC() @@ -86,7 +86,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testCOUPDAYBS($expectedResult, ...$args) { $result = Financial::COUPDAYBS(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerCOUPDAYBS() @@ -102,7 +102,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testCOUPDAYS($expectedResult, ...$args) { $result = Financial::COUPDAYS(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerCOUPDAYS() @@ -118,7 +118,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testCOUPDAYSNC($expectedResult, ...$args) { $result = Financial::COUPDAYSNC(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerCOUPDAYSNC() @@ -134,7 +134,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testCOUPNCD($expectedResult, ...$args) { $result = Financial::COUPNCD(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerCOUPNCD() @@ -150,7 +150,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testCOUPNUM($expectedResult, ...$args) { $result = Financial::COUPNUM(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerCOUPNUM() @@ -166,7 +166,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testCOUPPCD($expectedResult, ...$args) { $result = Financial::COUPPCD(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerCOUPPCD() @@ -182,7 +182,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testCUMIPMT($expectedResult, ...$args) { $result = Financial::CUMIPMT(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerCUMIPMT() @@ -198,7 +198,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testCUMPRINC($expectedResult, ...$args) { $result = Financial::CUMPRINC(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerCUMPRINC() @@ -214,7 +214,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testDB($expectedResult, ...$args) { $result = Financial::DB(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerDB() @@ -230,7 +230,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testDDB($expectedResult, ...$args) { $result = Financial::DDB(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerDDB() @@ -246,7 +246,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testDISC($expectedResult, ...$args) { $result = Financial::DISC(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerDISC() @@ -262,7 +262,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testDOLLARDE($expectedResult, ...$args) { $result = Financial::DOLLARDE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerDOLLARDE() @@ -278,7 +278,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testDOLLARFR($expectedResult, ...$args) { $result = Financial::DOLLARFR(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerDOLLARFR() @@ -294,7 +294,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testEFFECT($expectedResult, ...$args) { $result = Financial::EFFECT(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerEFFECT() @@ -310,7 +310,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testFV($expectedResult, ...$args) { $result = Financial::FV(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerFV() @@ -326,7 +326,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testFVSCHEDULE($expectedResult, ...$args) { $result = Financial::FVSCHEDULE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerFVSCHEDULE() @@ -342,7 +342,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testINTRATE($expectedResult, ...$args) { $result = Financial::INTRATE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerINTRATE() @@ -358,7 +358,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testIPMT($expectedResult, ...$args) { $result = Financial::IPMT(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIPMT() @@ -374,7 +374,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testIRR($expectedResult, ...$args) { $result = Financial::IRR(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIRR() @@ -390,7 +390,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testISPMT($expectedResult, ...$args) { $result = Financial::ISPMT(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerISPMT() @@ -406,7 +406,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testMIRR($expectedResult, ...$args) { $result = Financial::MIRR(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerMIRR() @@ -422,7 +422,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testNOMINAL($expectedResult, ...$args) { $result = Financial::NOMINAL(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerNOMINAL() @@ -438,7 +438,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testNPER($expectedResult, ...$args) { $result = Financial::NPER(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerNPER() @@ -454,7 +454,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase public function testNPV($expectedResult, ...$args) { $result = Financial::NPV(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerNPV() @@ -473,7 +473,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase $this->markTestIncomplete('TODO: This test should be fixed'); $result = Financial::PRICE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerPRICE() @@ -492,7 +492,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase $this->markTestIncomplete('TODO: This test should be fixed'); $result = Financial::RATE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerRATE() @@ -511,7 +511,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase $this->markTestIncomplete('TODO: This test should be fixed'); $result = Financial::XIRR(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerXIRR() diff --git a/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php index 371f2826..af611a74 100644 --- a/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php @@ -15,49 +15,49 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testDUMMY() { $result = Functions::DUMMY(); - $this->assertEquals('#Not Yet Implemented', $result); + self::assertEquals('#Not Yet Implemented', $result); } public function testDIV0() { $result = Functions::DIV0(); - $this->assertEquals('#DIV/0!', $result); + self::assertEquals('#DIV/0!', $result); } public function testNA() { $result = Functions::NA(); - $this->assertEquals('#N/A', $result); + self::assertEquals('#N/A', $result); } public function testNAN() { $result = Functions::NAN(); - $this->assertEquals('#NUM!', $result); + self::assertEquals('#NUM!', $result); } public function testNAME() { $result = Functions::NAME(); - $this->assertEquals('#NAME?', $result); + self::assertEquals('#NAME?', $result); } public function testREF() { $result = Functions::REF(); - $this->assertEquals('#REF!', $result); + self::assertEquals('#REF!', $result); } public function testNULL() { $result = Functions::null(); - $this->assertEquals('#NULL!', $result); + self::assertEquals('#NULL!', $result); } public function testVALUE() { $result = Functions::VALUE(); - $this->assertEquals('#VALUE!', $result); + self::assertEquals('#VALUE!', $result); } /** @@ -68,7 +68,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testIsBlank($expectedResult, ...$args) { $result = Functions::isBlank(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIsBlank() @@ -84,7 +84,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testIsErr($expectedResult, ...$args) { $result = Functions::isErr(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIsErr() @@ -100,7 +100,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testIsError($expectedResult, ...$args) { $result = Functions::isError(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIsError() @@ -116,7 +116,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testErrorType($expectedResult, ...$args) { $result = Functions::errorType(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerErrorType() @@ -132,7 +132,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testIsLogical($expectedResult, ...$args) { $result = Functions::isLogical(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIsLogical() @@ -148,7 +148,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testIsNa($expectedResult, ...$args) { $result = Functions::isNa(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIsNa() @@ -164,7 +164,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testIsNumber($expectedResult, ...$args) { $result = Functions::isNumber(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIsNumber() @@ -180,7 +180,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testIsText($expectedResult, ...$args) { $result = Functions::isText(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIsText() @@ -196,7 +196,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testIsNonText($expectedResult, ...$args) { $result = Functions::isNonText(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIsNonText() @@ -212,7 +212,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testIsEven($expectedResult, ...$args) { $result = Functions::isEven(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIsEven() @@ -228,7 +228,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testIsOdd($expectedResult, ...$args) { $result = Functions::isOdd(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIsOdd() @@ -244,7 +244,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testTYPE($expectedResult, ...$args) { $result = Functions::TYPE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerTYPE() @@ -260,7 +260,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase public function testN($expectedResult, ...$args) { $result = Functions::n(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerN() diff --git a/tests/PhpSpreadsheetTests/Calculation/LogicalTest.php b/tests/PhpSpreadsheetTests/Calculation/LogicalTest.php index d1aac26a..d9c70c2f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/LogicalTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/LogicalTest.php @@ -16,13 +16,13 @@ class LogicalTest extends PHPUnit_Framework_TestCase public function testTRUE() { $result = Logical::TRUE(); - $this->assertTrue($result); + self::assertTrue($result); } public function testFALSE() { $result = Logical::FALSE(); - $this->assertFalse($result); + self::assertFalse($result); } /** @@ -33,7 +33,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase public function testAND($expectedResult, ...$args) { $result = Logical::logicalAnd(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerAND() @@ -49,7 +49,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase public function testOR($expectedResult, ...$args) { $result = Logical::logicalOr(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerOR() @@ -65,7 +65,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase public function testNOT($expectedResult, ...$args) { $result = Logical::NOT(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerNOT() @@ -81,7 +81,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase public function testIF($expectedResult, ...$args) { $result = Logical::statementIf(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerIF() @@ -97,7 +97,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase public function testIFERROR($expectedResult, ...$args) { $result = Logical::IFERROR(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerIFERROR() diff --git a/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php b/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php index 94696e4c..2671a529 100644 --- a/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php @@ -25,7 +25,7 @@ class LookupRefTest extends PHPUnit_Framework_TestCase public function testHLOOKUP($expectedResult, ...$args) { $result = LookupRef::HLOOKUP(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerHLOOKUP() @@ -42,7 +42,7 @@ class LookupRefTest extends PHPUnit_Framework_TestCase public function testVLOOKUP($expectedResult, ...$args) { $result = LookupRef::VLOOKUP(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerVLOOKUP() @@ -59,7 +59,7 @@ class LookupRefTest extends PHPUnit_Framework_TestCase public function testMATCH($expectedResult, ...$args) { $result = LookupRef::MATCH(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerMATCH() diff --git a/tests/PhpSpreadsheetTests/Calculation/MathTrigTest.php b/tests/PhpSpreadsheetTests/Calculation/MathTrigTest.php index d765931c..29b9b57c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/MathTrigTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/MathTrigTest.php @@ -22,7 +22,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testATAN2($expectedResult, ...$args) { $result = MathTrig::ATAN2(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerATAN2() @@ -38,7 +38,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testCEILING($expectedResult, ...$args) { $result = MathTrig::CEILING(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerCEILING() @@ -54,7 +54,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testCOMBIN($expectedResult, ...$args) { $result = MathTrig::COMBIN(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerCOMBIN() @@ -70,7 +70,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testEVEN($expectedResult, ...$args) { $result = MathTrig::EVEN(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerEVEN() @@ -86,7 +86,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testODD($expectedResult, ...$args) { $result = MathTrig::ODD(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerODD() @@ -102,7 +102,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testFACT($expectedResult, ...$args) { $result = MathTrig::FACT(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerFACT() @@ -118,7 +118,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testFACTDOUBLE($expectedResult, ...$args) { $result = MathTrig::FACTDOUBLE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerFACTDOUBLE() @@ -134,7 +134,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testFLOOR($expectedResult, ...$args) { $result = MathTrig::FLOOR(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerFLOOR() @@ -150,7 +150,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testGCD($expectedResult, ...$args) { $result = MathTrig::GCD(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerGCD() @@ -166,7 +166,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testLCM($expectedResult, ...$args) { $result = MathTrig::LCM(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerLCM() @@ -182,7 +182,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testINT($expectedResult, ...$args) { $result = MathTrig::INT(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerINT() @@ -198,7 +198,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testSIGN($expectedResult, ...$args) { $result = MathTrig::SIGN(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerSIGN() @@ -214,7 +214,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testPOWER($expectedResult, ...$args) { $result = MathTrig::POWER(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerPOWER() @@ -230,7 +230,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testLOG($expectedResult, ...$args) { $result = MathTrig::logBase(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerLOG() @@ -246,7 +246,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testMOD($expectedResult, ...$args) { $result = MathTrig::MOD(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerMOD() @@ -262,7 +262,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testMDETERM($expectedResult, ...$args) { $result = MathTrig::MDETERM(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerMDETERM() @@ -281,7 +281,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase $this->markTestIncomplete('TODO: This test should be fixed'); $result = MathTrig::MINVERSE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerMINVERSE() @@ -300,7 +300,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase $this->markTestIncomplete('TODO: This test should be fixed'); $result = MathTrig::MMULT(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerMMULT() @@ -316,7 +316,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testMULTINOMIAL($expectedResult, ...$args) { $result = MathTrig::MULTINOMIAL(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerMULTINOMIAL() @@ -334,7 +334,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase Calculation::setArrayReturnType(Calculation::RETURN_ARRAY_AS_VALUE); $result = MathTrig::MROUND(...$args); Calculation::setArrayReturnType(Calculation::RETURN_ARRAY_AS_ARRAY); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerMROUND() @@ -350,7 +350,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testPRODUCT($expectedResult, ...$args) { $result = MathTrig::PRODUCT(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerPRODUCT() @@ -366,7 +366,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testQUOTIENT($expectedResult, ...$args) { $result = MathTrig::QUOTIENT(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerQUOTIENT() @@ -382,7 +382,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testROUNDUP($expectedResult, ...$args) { $result = MathTrig::ROUNDUP(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerROUNDUP() @@ -398,7 +398,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testROUNDDOWN($expectedResult, ...$args) { $result = MathTrig::ROUNDDOWN(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerROUNDDOWN() @@ -414,7 +414,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testSERIESSUM($expectedResult, ...$args) { $result = MathTrig::SERIESSUM(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerSERIESSUM() @@ -430,7 +430,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testSUMSQ($expectedResult, ...$args) { $result = MathTrig::SUMSQ(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerSUMSQ() @@ -446,7 +446,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testTRUNC($expectedResult, ...$args) { $result = MathTrig::TRUNC(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerTRUNC() @@ -462,7 +462,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testROMAN($expectedResult, ...$args) { $result = MathTrig::ROMAN(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerROMAN() @@ -478,7 +478,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testSQRTPI($expectedResult, ...$args) { $result = MathTrig::SQRTPI(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerSQRTPI() @@ -494,7 +494,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase public function testSUMIF($expectedResult, ...$args) { $result = MathTrig::SUMIF(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, 1E-12); } public function providerSUMIF() diff --git a/tests/PhpSpreadsheetTests/Calculation/TextDataTest.php b/tests/PhpSpreadsheetTests/Calculation/TextDataTest.php index 8a6cd0c5..84188689 100644 --- a/tests/PhpSpreadsheetTests/Calculation/TextDataTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/TextDataTest.php @@ -22,7 +22,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testCHAR($expectedResult, ...$args) { $result = TextData::CHARACTER(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerCHAR() @@ -38,7 +38,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testCODE($expectedResult, ...$args) { $result = TextData::ASCIICODE(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerCODE() @@ -54,7 +54,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testCONCATENATE($expectedResult, ...$args) { $result = TextData::CONCATENATE(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerCONCATENATE() @@ -70,7 +70,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testLEFT($expectedResult, ...$args) { $result = TextData::LEFT(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerLEFT() @@ -86,7 +86,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testMID($expectedResult, ...$args) { $result = TextData::MID(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerMID() @@ -102,7 +102,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testRIGHT($expectedResult, ...$args) { $result = TextData::RIGHT(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerRIGHT() @@ -118,7 +118,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testLOWER($expectedResult, ...$args) { $result = TextData::LOWERCASE(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerLOWER() @@ -134,7 +134,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testUPPER($expectedResult, ...$args) { $result = TextData::UPPERCASE(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerUPPER() @@ -150,7 +150,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testPROPER($expectedResult, ...$args) { $result = TextData::PROPERCASE(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerPROPER() @@ -166,7 +166,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testLEN($expectedResult, ...$args) { $result = TextData::STRINGLENGTH(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerLEN() @@ -182,7 +182,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testSEARCH($expectedResult, ...$args) { $result = TextData::SEARCHINSENSITIVE(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerSEARCH() @@ -198,7 +198,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testFIND($expectedResult, ...$args) { $result = TextData::SEARCHSENSITIVE(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerFIND() @@ -214,7 +214,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testREPLACE($expectedResult, ...$args) { $result = TextData::REPLACE(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerREPLACE() @@ -230,7 +230,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testSUBSTITUTE($expectedResult, ...$args) { $result = TextData::SUBSTITUTE(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerSUBSTITUTE() @@ -246,7 +246,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testTRIM($expectedResult, ...$args) { $result = TextData::TRIMSPACES(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerTRIM() @@ -262,7 +262,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testCLEAN($expectedResult, ...$args) { $result = TextData::TRIMNONPRINTABLE(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerCLEAN() @@ -278,7 +278,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testDOLLAR($expectedResult, ...$args) { $result = TextData::DOLLAR(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerDOLLAR() @@ -294,7 +294,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testFIXED($expectedResult, ...$args) { $result = TextData::FIXEDFORMAT(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerFIXED() @@ -310,7 +310,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase public function testT($expectedResult, ...$args) { $result = TextData::RETURNSTRING(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerT() @@ -331,7 +331,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase StringHelper::setCurrencyCode('$'); $result = TextData::TEXTFORMAT(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerTEXT() @@ -351,7 +351,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase StringHelper::setCurrencyCode('$'); $result = TextData::VALUE(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerVALUE() diff --git a/tests/PhpSpreadsheetTests/CalculationTest.php b/tests/PhpSpreadsheetTests/CalculationTest.php index d8979979..3d89b9a0 100644 --- a/tests/PhpSpreadsheetTests/CalculationTest.php +++ b/tests/PhpSpreadsheetTests/CalculationTest.php @@ -24,11 +24,11 @@ class CalculationTest extends PHPUnit_Framework_TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $resultExcel = Calculation::getInstance()->_calculateFormulaValue($formula); - $this->assertEquals($expectedResultExcel, $resultExcel, 'should be Excel compatible'); + self::assertEquals($expectedResultExcel, $resultExcel, 'should be Excel compatible'); Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); $resultOpenOffice = Calculation::getInstance()->_calculateFormulaValue($formula); - $this->assertEquals($expectedResultOpenOffice, $resultOpenOffice, 'should be OpenOffice compatible'); + self::assertEquals($expectedResultOpenOffice, $resultOpenOffice, 'should be OpenOffice compatible'); } public function providerBinaryComparisonOperation() @@ -45,7 +45,7 @@ class CalculationTest extends PHPUnit_Framework_TestCase */ public function testGetFunctions($category, $functionCall, $argumentCount) { - $this->assertInternalType('callable', $functionCall); + self::assertInternalType('callable', $functionCall); } public function providerGetFunctions() @@ -56,10 +56,10 @@ class CalculationTest extends PHPUnit_Framework_TestCase public function testIsImplemented() { $calculation = Calculation::getInstance(); - $this->assertFalse($calculation->isImplemented('non-existing-function')); - $this->assertFalse($calculation->isImplemented('AREAS')); - $this->assertTrue($calculation->isImplemented('coUNt')); - $this->assertTrue($calculation->isImplemented('abs')); + self::assertFalse($calculation->isImplemented('non-existing-function')); + self::assertFalse($calculation->isImplemented('AREAS')); + self::assertTrue($calculation->isImplemented('coUNt')); + self::assertTrue($calculation->isImplemented('abs')); } /** @@ -70,7 +70,7 @@ class CalculationTest extends PHPUnit_Framework_TestCase public function testCanLoadAllSupportedLocales($locale) { $calculation = Calculation::getInstance(); - $this->assertTrue($calculation->setLocale($locale)); + self::assertTrue($calculation->setLocale($locale)); } public function providerCanLoadAllSupportedLocales() diff --git a/tests/PhpSpreadsheetTests/Cell/AdvancedValueBinderTest.php b/tests/PhpSpreadsheetTests/Cell/AdvancedValueBinderTest.php index 637ced24..f189d1ff 100644 --- a/tests/PhpSpreadsheetTests/Cell/AdvancedValueBinderTest.php +++ b/tests/PhpSpreadsheetTests/Cell/AdvancedValueBinderTest.php @@ -74,6 +74,6 @@ class AdvancedValueBinderTest extends PHPUnit_Framework_TestCase $binder = new AdvancedValueBinder(); $binder->bindValue($cell, $value); - $this->assertEquals($valueBinded, $cell->getValue()); + self::assertEquals($valueBinded, $cell->getValue()); } } diff --git a/tests/PhpSpreadsheetTests/Cell/DataTypeTest.php b/tests/PhpSpreadsheetTests/Cell/DataTypeTest.php index 92ab1f29..e46820f3 100644 --- a/tests/PhpSpreadsheetTests/Cell/DataTypeTest.php +++ b/tests/PhpSpreadsheetTests/Cell/DataTypeTest.php @@ -10,8 +10,8 @@ class DataTypeTest extends PHPUnit_Framework_TestCase public function testGetErrorCodes() { $result = DataType::getErrorCodes(); - $this->assertInternalType('array', $result); - $this->assertGreaterThan(0, count($result)); - $this->assertArrayHasKey('#NULL!', $result); + self::assertInternalType('array', $result); + self::assertGreaterThan(0, count($result)); + self::assertArrayHasKey('#NULL!', $result); } } diff --git a/tests/PhpSpreadsheetTests/Cell/DefaultValueBinderTest.php b/tests/PhpSpreadsheetTests/Cell/DefaultValueBinderTest.php index 4d09a56a..0b74e075 100644 --- a/tests/PhpSpreadsheetTests/Cell/DefaultValueBinderTest.php +++ b/tests/PhpSpreadsheetTests/Cell/DefaultValueBinderTest.php @@ -35,7 +35,7 @@ class DefaultValueBinderTest extends PHPUnit_Framework_TestCase $this->createCellStub(); $binder = new DefaultValueBinder(); $result = $binder->bindValue($this->cellStub, $value); - $this->assertTrue($result); + self::assertTrue($result); } public function binderProvider() @@ -64,7 +64,7 @@ class DefaultValueBinderTest extends PHPUnit_Framework_TestCase public function testDataTypeForValue($expectedResult, ...$args) { $result = DefaultValueBinder::dataTypeForValue(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerDataTypeForValue() @@ -79,6 +79,6 @@ class DefaultValueBinderTest extends PHPUnit_Framework_TestCase $expectedResult = DataType::TYPE_INLINE; $result = DefaultValueBinder::dataTypeForValue($objRichText); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } } diff --git a/tests/PhpSpreadsheetTests/Cell/HyperlinkTest.php b/tests/PhpSpreadsheetTests/Cell/HyperlinkTest.php index 3d86cb62..419a8c91 100644 --- a/tests/PhpSpreadsheetTests/Cell/HyperlinkTest.php +++ b/tests/PhpSpreadsheetTests/Cell/HyperlinkTest.php @@ -14,7 +14,7 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase $testInstance = new Hyperlink($urlValue); $result = $testInstance->getUrl(); - $this->assertEquals($urlValue, $result); + self::assertEquals($urlValue, $result); } public function testSetUrl() @@ -24,10 +24,10 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase $testInstance = new Hyperlink($initialUrlValue); $result = $testInstance->setUrl($newUrlValue); - $this->assertTrue($result instanceof Hyperlink); + self::assertTrue($result instanceof Hyperlink); $result = $testInstance->getUrl(); - $this->assertEquals($newUrlValue, $result); + self::assertEquals($newUrlValue, $result); } public function testGetTooltip() @@ -37,7 +37,7 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase $testInstance = new Hyperlink(null, $tooltipValue); $result = $testInstance->getTooltip(); - $this->assertEquals($tooltipValue, $result); + self::assertEquals($tooltipValue, $result); } public function testSetTooltip() @@ -47,10 +47,10 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase $testInstance = new Hyperlink(null, $initialTooltipValue); $result = $testInstance->setTooltip($newTooltipValue); - $this->assertTrue($result instanceof Hyperlink); + self::assertTrue($result instanceof Hyperlink); $result = $testInstance->getTooltip(); - $this->assertEquals($newTooltipValue, $result); + self::assertEquals($newTooltipValue, $result); } public function testIsInternal() @@ -60,11 +60,11 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase $testInstance = new Hyperlink($initialUrlValue); $result = $testInstance->isInternal(); - $this->assertFalse($result); + self::assertFalse($result); $testInstance->setUrl($newUrlValue); $result = $testInstance->isInternal(); - $this->assertTrue($result); + self::assertTrue($result); } public function testGetHashCode() @@ -76,6 +76,6 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase $testInstance = new Hyperlink($urlValue, $tooltipValue); $result = $testInstance->getHashCode(); - $this->assertEquals($initialExpectedHash, $result); + self::assertEquals($initialExpectedHash, $result); } } diff --git a/tests/PhpSpreadsheetTests/CellTest.php b/tests/PhpSpreadsheetTests/CellTest.php index 3a7d429e..6f03593a 100644 --- a/tests/PhpSpreadsheetTests/CellTest.php +++ b/tests/PhpSpreadsheetTests/CellTest.php @@ -16,7 +16,7 @@ class CellTest extends PHPUnit_Framework_TestCase public function testColumnIndexFromString($expectedResult, ...$args) { $result = Cell::columnIndexFromString(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerColumnString() @@ -30,8 +30,8 @@ class CellTest extends PHPUnit_Framework_TestCase try { Cell::columnIndexFromString($cellAddress); } catch (\Exception $e) { - $this->assertInstanceOf(Exception::class, $e); - $this->assertEquals($e->getMessage(), 'Column string index can not be longer than 3 characters'); + self::assertInstanceOf(Exception::class, $e); + self::assertEquals($e->getMessage(), 'Column string index can not be longer than 3 characters'); return; } @@ -44,8 +44,8 @@ class CellTest extends PHPUnit_Framework_TestCase try { Cell::columnIndexFromString($cellAddress); } catch (\Exception $e) { - $this->assertInstanceOf(Exception::class, $e); - $this->assertEquals($e->getMessage(), 'Column string index can not be empty'); + self::assertInstanceOf(Exception::class, $e); + self::assertEquals($e->getMessage(), 'Column string index can not be empty'); return; } @@ -60,7 +60,7 @@ class CellTest extends PHPUnit_Framework_TestCase public function testStringFromColumnIndex($expectedResult, ...$args) { $result = Cell::stringFromColumnIndex(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerColumnIndex() @@ -76,7 +76,7 @@ class CellTest extends PHPUnit_Framework_TestCase public function testCoordinateFromString($expectedResult, ...$args) { $result = Cell::coordinateFromString(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerCoordinates() @@ -90,8 +90,8 @@ class CellTest extends PHPUnit_Framework_TestCase try { Cell::coordinateFromString($cellAddress); } catch (\Exception $e) { - $this->assertInstanceOf(Exception::class, $e); - $this->assertEquals($e->getMessage(), 'Cell coordinate string can not be a range of cells'); + self::assertInstanceOf(Exception::class, $e); + self::assertEquals($e->getMessage(), 'Cell coordinate string can not be a range of cells'); return; } @@ -104,8 +104,8 @@ class CellTest extends PHPUnit_Framework_TestCase try { Cell::coordinateFromString($cellAddress); } catch (\Exception $e) { - $this->assertInstanceOf(Exception::class, $e); - $this->assertEquals($e->getMessage(), 'Cell coordinate can not be zero-length string'); + self::assertInstanceOf(Exception::class, $e); + self::assertEquals($e->getMessage(), 'Cell coordinate can not be zero-length string'); return; } @@ -118,8 +118,8 @@ class CellTest extends PHPUnit_Framework_TestCase try { Cell::coordinateFromString($cellAddress); } catch (\Exception $e) { - $this->assertInstanceOf(Exception::class, $e); - $this->assertEquals($e->getMessage(), 'Invalid cell coordinate ' . $cellAddress); + self::assertInstanceOf(Exception::class, $e); + self::assertEquals($e->getMessage(), 'Invalid cell coordinate ' . $cellAddress); return; } @@ -134,7 +134,7 @@ class CellTest extends PHPUnit_Framework_TestCase public function testAbsoluteCoordinateFromString($expectedResult, ...$args) { $result = Cell::absoluteCoordinate(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerAbsoluteCoordinates() @@ -148,8 +148,8 @@ class CellTest extends PHPUnit_Framework_TestCase try { Cell::absoluteCoordinate($cellAddress); } catch (\Exception $e) { - $this->assertInstanceOf(Exception::class, $e); - $this->assertEquals($e->getMessage(), 'Cell coordinate string can not be a range of cells'); + self::assertInstanceOf(Exception::class, $e); + self::assertEquals($e->getMessage(), 'Cell coordinate string can not be a range of cells'); return; } @@ -164,7 +164,7 @@ class CellTest extends PHPUnit_Framework_TestCase public function testAbsoluteReferenceFromString($expectedResult, ...$args) { $result = Cell::absoluteReference(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerAbsoluteReferences() @@ -178,8 +178,8 @@ class CellTest extends PHPUnit_Framework_TestCase try { Cell::absoluteReference($cellAddress); } catch (\Exception $e) { - $this->assertInstanceOf(Exception::class, $e); - $this->assertEquals($e->getMessage(), 'Cell coordinate string can not be a range of cells'); + self::assertInstanceOf(Exception::class, $e); + self::assertEquals($e->getMessage(), 'Cell coordinate string can not be a range of cells'); return; } @@ -196,9 +196,9 @@ class CellTest extends PHPUnit_Framework_TestCase $result = Cell::splitRange(...$args); foreach ($result as $key => $split) { if (!is_array($expectedResult[$key])) { - $this->assertEquals($expectedResult[$key], $split[0]); + self::assertEquals($expectedResult[$key], $split[0]); } else { - $this->assertEquals($expectedResult[$key], $split); + self::assertEquals($expectedResult[$key], $split); } } } @@ -216,7 +216,7 @@ class CellTest extends PHPUnit_Framework_TestCase public function testBuildRange($expectedResult, ...$args) { $result = Cell::buildRange(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerBuildRange() @@ -245,7 +245,7 @@ class CellTest extends PHPUnit_Framework_TestCase public function testRangeBoundaries($expectedResult, ...$args) { $result = Cell::rangeBoundaries(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerRangeBoundaries() @@ -261,7 +261,7 @@ class CellTest extends PHPUnit_Framework_TestCase public function testRangeDimension($expectedResult, ...$args) { $result = Cell::rangeDimension(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerRangeDimension() @@ -277,7 +277,7 @@ class CellTest extends PHPUnit_Framework_TestCase public function testGetRangeBoundaries($expectedResult, ...$args) { $result = Cell::getRangeBoundaries(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerGetRangeBoundaries() @@ -293,7 +293,7 @@ class CellTest extends PHPUnit_Framework_TestCase public function testExtractAllCellReferencesInRange($expectedResult, ...$args) { $result = Cell::extractAllCellReferencesInRange(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerExtractAllCellReferencesInRange() @@ -309,7 +309,7 @@ class CellTest extends PHPUnit_Framework_TestCase public function testMergeRangesInCollection($expectedResult, ...$args) { $result = Cell::mergeRangesInCollection(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerMergeRangesInCollection() diff --git a/tests/PhpSpreadsheetTests/Chart/DataSeriesValuesTest.php b/tests/PhpSpreadsheetTests/Chart/DataSeriesValuesTest.php index a7746b16..cdb46435 100644 --- a/tests/PhpSpreadsheetTests/Chart/DataSeriesValuesTest.php +++ b/tests/PhpSpreadsheetTests/Chart/DataSeriesValuesTest.php @@ -19,7 +19,7 @@ class DataSeriesValuesTest extends PHPUnit_Framework_TestCase foreach ($dataTypeValues as $dataTypeValue) { $result = $testInstance->setDataType($dataTypeValue); - $this->assertTrue($result instanceof DataSeriesValues); + self::assertTrue($result instanceof DataSeriesValues); } } @@ -30,7 +30,7 @@ class DataSeriesValuesTest extends PHPUnit_Framework_TestCase try { $testInstance->setDataType('BOOLEAN'); } catch (Exception $e) { - $this->assertEquals($e->getMessage(), 'Invalid datatype for chart data series values'); + self::assertEquals($e->getMessage(), 'Invalid datatype for chart data series values'); return; } @@ -45,6 +45,6 @@ class DataSeriesValuesTest extends PHPUnit_Framework_TestCase $testInstance->setDataType($dataTypeValue); $result = $testInstance->getDataType(); - $this->assertEquals($dataTypeValue, $result); + self::assertEquals($dataTypeValue, $result); } } diff --git a/tests/PhpSpreadsheetTests/Chart/LayoutTest.php b/tests/PhpSpreadsheetTests/Chart/LayoutTest.php index 22daa18d..67cd5878 100644 --- a/tests/PhpSpreadsheetTests/Chart/LayoutTest.php +++ b/tests/PhpSpreadsheetTests/Chart/LayoutTest.php @@ -14,7 +14,7 @@ class LayoutTest extends PHPUnit_Framework_TestCase $testInstance = new Layout(); $result = $testInstance->setLayoutTarget($LayoutTargetValue); - $this->assertTrue($result instanceof Layout); + self::assertTrue($result instanceof Layout); } public function testGetLayoutTarget() @@ -25,6 +25,6 @@ class LayoutTest extends PHPUnit_Framework_TestCase $setValue = $testInstance->setLayoutTarget($LayoutTargetValue); $result = $testInstance->getLayoutTarget(); - $this->assertEquals($LayoutTargetValue, $result); + self::assertEquals($LayoutTargetValue, $result); } } diff --git a/tests/PhpSpreadsheetTests/Chart/LegendTest.php b/tests/PhpSpreadsheetTests/Chart/LegendTest.php index 1df0ab70..82d3243b 100644 --- a/tests/PhpSpreadsheetTests/Chart/LegendTest.php +++ b/tests/PhpSpreadsheetTests/Chart/LegendTest.php @@ -21,7 +21,7 @@ class LegendTest extends PHPUnit_Framework_TestCase foreach ($positionValues as $positionValue) { $result = $testInstance->setPosition($positionValue); - $this->assertTrue($result); + self::assertTrue($result); } } @@ -30,10 +30,10 @@ class LegendTest extends PHPUnit_Framework_TestCase $testInstance = new Legend(); $result = $testInstance->setPosition('BottomLeft'); - $this->assertFalse($result); + self::assertFalse($result); // Ensure that value is unchanged $result = $testInstance->getPosition(); - $this->assertEquals(Legend::POSITION_RIGHT, $result); + self::assertEquals(Legend::POSITION_RIGHT, $result); } public function testGetPosition() @@ -44,7 +44,7 @@ class LegendTest extends PHPUnit_Framework_TestCase $setValue = $testInstance->setPosition($PositionValue); $result = $testInstance->getPosition(); - $this->assertEquals($PositionValue, $result); + self::assertEquals($PositionValue, $result); } public function testSetPositionXL() @@ -62,7 +62,7 @@ class LegendTest extends PHPUnit_Framework_TestCase foreach ($positionValues as $positionValue) { $result = $testInstance->setPositionXL($positionValue); - $this->assertTrue($result); + self::assertTrue($result); } } @@ -71,10 +71,10 @@ class LegendTest extends PHPUnit_Framework_TestCase $testInstance = new Legend(); $result = $testInstance->setPositionXL(999); - $this->assertFalse($result); + self::assertFalse($result); // Ensure that value is unchanged $result = $testInstance->getPositionXL(); - $this->assertEquals(Legend::XL_LEGEND_POSITION_RIGHT, $result); + self::assertEquals(Legend::XL_LEGEND_POSITION_RIGHT, $result); } public function testGetPositionXL() @@ -85,7 +85,7 @@ class LegendTest extends PHPUnit_Framework_TestCase $setValue = $testInstance->setPositionXL($PositionValue); $result = $testInstance->getPositionXL(); - $this->assertEquals($PositionValue, $result); + self::assertEquals($PositionValue, $result); } public function testSetOverlay() @@ -99,7 +99,7 @@ class LegendTest extends PHPUnit_Framework_TestCase foreach ($overlayValues as $overlayValue) { $result = $testInstance->setOverlay($overlayValue); - $this->assertTrue($result); + self::assertTrue($result); } } @@ -108,10 +108,10 @@ class LegendTest extends PHPUnit_Framework_TestCase $testInstance = new Legend(); $result = $testInstance->setOverlay('INVALID'); - $this->assertFalse($result); + self::assertFalse($result); $result = $testInstance->getOverlay(); - $this->assertFalse($result); + self::assertFalse($result); } public function testGetOverlay() @@ -122,6 +122,6 @@ class LegendTest extends PHPUnit_Framework_TestCase $setValue = $testInstance->setOverlay($OverlayValue); $result = $testInstance->getOverlay(); - $this->assertEquals($OverlayValue, $result); + self::assertEquals($OverlayValue, $result); } } diff --git a/tests/PhpSpreadsheetTests/Collection/CellsTest.php b/tests/PhpSpreadsheetTests/Collection/CellsTest.php index 33899be7..a05107a2 100644 --- a/tests/PhpSpreadsheetTests/Collection/CellsTest.php +++ b/tests/PhpSpreadsheetTests/Collection/CellsTest.php @@ -18,49 +18,49 @@ class CellsTest extends PHPUnit_Framework_TestCase $collection = $sheet->getCellCollection(); // Assert empty state - $this->assertEquals([], $collection->getCoordinates(), 'cell list should be empty'); - $this->assertEquals([], $collection->getSortedCoordinates(), 'sorted cell list should be empty'); - $this->assertNull($collection->get('B2'), 'getting non-existing cell must return null'); - $this->assertFalse($collection->has('B2'), 'non-existing cell should be non-existent'); + self::assertEquals([], $collection->getCoordinates(), 'cell list should be empty'); + self::assertEquals([], $collection->getSortedCoordinates(), 'sorted cell list should be empty'); + self::assertNull($collection->get('B2'), 'getting non-existing cell must return null'); + self::assertFalse($collection->has('B2'), 'non-existing cell should be non-existent'); // Add one cell $cell1 = $sheet->getCell('B2'); - $this->assertSame($cell1, $collection->add('B2', $cell1), 'adding a cell should return the cell'); + self::assertSame($cell1, $collection->add('B2', $cell1), 'adding a cell should return the cell'); // Assert cell presence - $this->assertEquals(['B2'], $collection->getCoordinates(), 'cell list should contains the cell'); - $this->assertEquals(['B2'], $collection->getSortedCoordinates(), 'sorted cell list contains the cell'); - $this->assertSame($cell1, $collection->get('B2'), 'should get exact same object'); - $this->assertTrue($collection->has('B2'), 'cell should exists'); + self::assertEquals(['B2'], $collection->getCoordinates(), 'cell list should contains the cell'); + self::assertEquals(['B2'], $collection->getSortedCoordinates(), 'sorted cell list contains the cell'); + self::assertSame($cell1, $collection->get('B2'), 'should get exact same object'); + self::assertTrue($collection->has('B2'), 'cell should exists'); // Add a second cell $cell2 = $sheet->getCell('A1'); - $this->assertSame($cell2, $collection->add('A1', $cell2), 'adding a second cell should return the cell'); - $this->assertEquals(['B2', 'A1'], $collection->getCoordinates(), 'cell list should contains the cell'); - $this->assertEquals(['A1', 'B2'], $collection->getSortedCoordinates(), 'sorted cell list contains the cell'); + self::assertSame($cell2, $collection->add('A1', $cell2), 'adding a second cell should return the cell'); + self::assertEquals(['B2', 'A1'], $collection->getCoordinates(), 'cell list should contains the cell'); + self::assertEquals(['A1', 'B2'], $collection->getSortedCoordinates(), 'sorted cell list contains the cell'); // Assert collection copy $sheet2 = $spreadsheet->createSheet(); $collection2 = $collection->cloneCellCollection($sheet2); - $this->assertTrue($collection2->has('A1')); + self::assertTrue($collection2->has('A1')); $copiedCell2 = $collection2->get('A1'); - $this->assertNotSame($cell2, $copiedCell2, 'copied cell should not be the same object any more'); - $this->assertSame($collection2, $copiedCell2->getParent(), 'copied cell should be owned by the copied collection'); - $this->assertSame('A1', $copiedCell2->getCoordinate(), 'copied cell should keep attributes'); + self::assertNotSame($cell2, $copiedCell2, 'copied cell should not be the same object any more'); + self::assertSame($collection2, $copiedCell2->getParent(), 'copied cell should be owned by the copied collection'); + self::assertSame('A1', $copiedCell2->getCoordinate(), 'copied cell should keep attributes'); // Assert deletion $collection->delete('B2'); - $this->assertFalse($collection->has('B2'), 'cell should have been deleted'); - $this->assertEquals(['A1'], $collection->getCoordinates(), 'cell list should contains the cell'); + self::assertFalse($collection->has('B2'), 'cell should have been deleted'); + self::assertEquals(['A1'], $collection->getCoordinates(), 'cell list should contains the cell'); // Assert update $cell2 = $sheet->getCell('A1'); - $this->assertSame($sheet->getCellCollection(), $collection); - $this->assertSame($cell2, $collection->update($cell2), 'should update existing cell'); + self::assertSame($sheet->getCellCollection(), $collection); + self::assertSame($cell2, $collection->update($cell2), 'should update existing cell'); $cell3 = $sheet->getCell('C3'); - $this->assertSame($cell3, $collection->update($cell3), 'should silently add non-existing cell'); - $this->assertEquals(['A1', 'C3'], $collection->getCoordinates(), 'cell list should contains the cell'); + self::assertSame($cell3, $collection->update($cell3), 'should silently add non-existing cell'); + self::assertEquals(['A1', 'C3'], $collection->getCoordinates(), 'cell list should contains the cell'); } public function testCacheLastCell() @@ -70,7 +70,7 @@ class CellsTest extends PHPUnit_Framework_TestCase $sheet = $workbook->getActiveSheet(); $sheet->setCellValue('A1', 1); $sheet->setCellValue('A2', 2); - $this->assertEquals($cells, $sheet->getCoordinates(), 'list should include last added cell'); + self::assertEquals($cells, $sheet->getCoordinates(), 'list should include last added cell'); } public function testCanGetCellAfterAnotherIsDeleted() @@ -82,7 +82,7 @@ class CellsTest extends PHPUnit_Framework_TestCase $sheet->setCellValue('A2', 1); $collection->delete('A1'); $sheet->setCellValue('A3', 1); - $this->assertNotNull($collection->get('A2'), 'should be able to get back the cell even when another cell was deleted while this one was the current one'); + self::assertNotNull($collection->get('A2'), 'should be able to get back the cell even when another cell was deleted while this one was the current one'); } /** diff --git a/tests/PhpSpreadsheetTests/Helper/MigratorTest.php b/tests/PhpSpreadsheetTests/Helper/MigratorTest.php index cb91f65a..dace06fb 100644 --- a/tests/PhpSpreadsheetTests/Helper/MigratorTest.php +++ b/tests/PhpSpreadsheetTests/Helper/MigratorTest.php @@ -13,7 +13,7 @@ class MigratorTest extends PHPUnit_Framework_TestCase foreach ($migrator->getMapping() as $classname) { if (substr_count($classname, '\\')) { - $this->assertTrue(class_exists($classname) || interface_exists($classname), 'mapping is wrong, class does not exists in project: ' . $classname); + self::assertTrue(class_exists($classname) || interface_exists($classname), 'mapping is wrong, class does not exists in project: ' . $classname); } } } diff --git a/tests/PhpSpreadsheetTests/IOFactoryTest.php b/tests/PhpSpreadsheetTests/IOFactoryTest.php index 071e4bb6..df1eb464 100644 --- a/tests/PhpSpreadsheetTests/IOFactoryTest.php +++ b/tests/PhpSpreadsheetTests/IOFactoryTest.php @@ -16,7 +16,7 @@ class IOFactoryTest extends PHPUnit_Framework_TestCase public function testIdentify($file, $expected) { $actual = IOFactory::identify($file); - $this->assertSame($expected, $actual); + self::assertSame($expected, $actual); } public function providerIdentify() diff --git a/tests/PhpSpreadsheetTests/Reader/CsvTest.php b/tests/PhpSpreadsheetTests/Reader/CsvTest.php index 90e94a52..14fddf07 100644 --- a/tests/PhpSpreadsheetTests/Reader/CsvTest.php +++ b/tests/PhpSpreadsheetTests/Reader/CsvTest.php @@ -25,20 +25,20 @@ class CsvTest extends PHPUnit_Framework_TestCase $reader = new ReaderCsv(); $reloadedSpreadsheet = $reader->load($filename); $actual = $reloadedSpreadsheet->getActiveSheet()->getCell('A1')->getCalculatedValue(); - $this->assertSame($value, $actual, 'should be able to write and read strings with multiples quotes'); + self::assertSame($value, $actual, 'should be able to write and read strings with multiples quotes'); } public function testDelimiterDetection() { $reader = new ReaderCsv(); - $this->assertNull($reader->getDelimiter()); + self::assertNull($reader->getDelimiter()); $filename = __DIR__ . '/../../data/Reader/CSV/semicolon_separated.csv'; $spreadsheet = $reader->load($filename); - $this->assertSame(';', $reader->getDelimiter(), 'should be able to infer the delimiter'); + self::assertSame(';', $reader->getDelimiter(), 'should be able to infer the delimiter'); $actual = $spreadsheet->getActiveSheet()->getCell('C2')->getValue(); - $this->assertSame('25,5', $actual, 'should be able to retrieve values with commas'); + self::assertSame('25,5', $actual, 'should be able to retrieve values with commas'); } } diff --git a/tests/PhpSpreadsheetTests/Reader/HTMLTest.php b/tests/PhpSpreadsheetTests/Reader/HTMLTest.php index ca85be9c..362d7fe6 100644 --- a/tests/PhpSpreadsheetTests/Reader/HTMLTest.php +++ b/tests/PhpSpreadsheetTests/Reader/HTMLTest.php @@ -11,6 +11,6 @@ class HTMLTest extends PHPUnit_Framework_TestCase { $filename = __DIR__ . '/../../data/Reader/HTML/csv_with_angle_bracket.csv'; $reader = new Html(); - $this->assertFalse($reader->canRead($filename)); + self::assertFalse($reader->canRead($filename)); } } diff --git a/tests/PhpSpreadsheetTests/Reader/OdsTest.php b/tests/PhpSpreadsheetTests/Reader/OdsTest.php index 658869b0..5c997f70 100644 --- a/tests/PhpSpreadsheetTests/Reader/OdsTest.php +++ b/tests/PhpSpreadsheetTests/Reader/OdsTest.php @@ -64,7 +64,7 @@ class OdsTest extends PHPUnit_Framework_TestCase // Test "listWorksheetNames" method - $this->assertEquals([ + self::assertEquals([ 'Sheet1', 'Second Sheet', ], $reader->listWorksheetNames($filename)); @@ -74,15 +74,15 @@ class OdsTest extends PHPUnit_Framework_TestCase { $spreadsheet = $this->loadDataFile(); - $this->assertInstanceOf('PhpOffice\PhpSpreadsheet\Spreadsheet', $spreadsheet); + self::assertInstanceOf('PhpOffice\PhpSpreadsheet\Spreadsheet', $spreadsheet); - $this->assertEquals(2, $spreadsheet->getSheetCount()); + self::assertEquals(2, $spreadsheet->getSheetCount()); $firstSheet = $spreadsheet->getSheet(0); - $this->assertInstanceOf('PhpOffice\PhpSpreadsheet\Worksheet', $firstSheet); + self::assertInstanceOf('PhpOffice\PhpSpreadsheet\Worksheet', $firstSheet); $secondSheet = $spreadsheet->getSheet(1); - $this->assertInstanceOf('PhpOffice\PhpSpreadsheet\Worksheet', $secondSheet); + self::assertInstanceOf('PhpOffice\PhpSpreadsheet\Worksheet', $secondSheet); } public function testReadValueAndComments() @@ -91,45 +91,45 @@ class OdsTest extends PHPUnit_Framework_TestCase $firstSheet = $spreadsheet->getSheet(0); - $this->assertEquals(29, $firstSheet->getHighestRow()); - $this->assertEquals('N', $firstSheet->getHighestColumn()); + self::assertEquals(29, $firstSheet->getHighestRow()); + self::assertEquals('N', $firstSheet->getHighestColumn()); // Simple cell value - $this->assertEquals('Test String 1', $firstSheet->getCell('A1')->getValue()); + self::assertEquals('Test String 1', $firstSheet->getCell('A1')->getValue()); // Merged cell - $this->assertEquals('BOX', $firstSheet->getCell('B18')->getValue()); + self::assertEquals('BOX', $firstSheet->getCell('B18')->getValue()); // Comments/Annotations - $this->assertEquals( + self::assertEquals( 'Test for a simple colour-formatted string', $firstSheet->getComment('A1')->getText()->getPlainText() ); // Data types - $this->assertEquals(DataType::TYPE_STRING, $firstSheet->getCell('A1')->getDataType()); - $this->assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('B1')->getDataType()); // Int + self::assertEquals(DataType::TYPE_STRING, $firstSheet->getCell('A1')->getDataType()); + self::assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('B1')->getDataType()); // Int - $this->assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('B6')->getDataType()); // Float - $this->assertEquals(1.23, $firstSheet->getCell('B6')->getValue()); - $this->assertEquals(0, $firstSheet->getCell('G10')->getValue()); + self::assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('B6')->getDataType()); // Float + self::assertEquals(1.23, $firstSheet->getCell('B6')->getValue()); + self::assertEquals(0, $firstSheet->getCell('G10')->getValue()); - $this->assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A10')->getDataType()); // Date - $this->assertEquals(22269.0, $firstSheet->getCell('A10')->getValue()); + self::assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A10')->getDataType()); // Date + self::assertEquals(22269.0, $firstSheet->getCell('A10')->getValue()); - $this->assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A13')->getDataType()); // Time - $this->assertEquals(25569.0625, $firstSheet->getCell('A13')->getValue()); + self::assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A13')->getDataType()); // Time + self::assertEquals(25569.0625, $firstSheet->getCell('A13')->getValue()); - $this->assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A15')->getDataType()); // Date + Time - $this->assertEquals(22269.0625, $firstSheet->getCell('A15')->getValue()); + self::assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A15')->getDataType()); // Date + Time + self::assertEquals(22269.0625, $firstSheet->getCell('A15')->getValue()); - $this->assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A11')->getDataType()); // Fraction + self::assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A11')->getDataType()); // Fraction - $this->assertEquals(DataType::TYPE_BOOL, $firstSheet->getCell('D6')->getDataType()); - $this->assertTrue($firstSheet->getCell('D6')->getValue()); + self::assertEquals(DataType::TYPE_BOOL, $firstSheet->getCell('D6')->getDataType()); + self::assertTrue($firstSheet->getCell('D6')->getValue()); - $this->assertEquals(DataType::TYPE_FORMULA, $firstSheet->getCell('C6')->getDataType()); // Formula - $this->assertEquals('=TRUE()', $firstSheet->getCell('C6')->getValue()); // Formula + self::assertEquals(DataType::TYPE_FORMULA, $firstSheet->getCell('C6')->getDataType()); // Formula + self::assertEquals('=TRUE()', $firstSheet->getCell('C6')->getValue()); // Formula /* * Percentage, Currency @@ -139,17 +139,17 @@ class OdsTest extends PHPUnit_Framework_TestCase $firstSheet = $spreadsheet->getSheet(0); - $this->assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A1')->getDataType()); // Percentage (10%) - $this->assertEquals(0.1, $firstSheet->getCell('A1')->getValue()); + self::assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A1')->getDataType()); // Percentage (10%) + self::assertEquals(0.1, $firstSheet->getCell('A1')->getValue()); - $this->assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A2')->getDataType()); // Percentage (10.00%) - $this->assertEquals(0.1, $firstSheet->getCell('A2')->getValue()); + self::assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A2')->getDataType()); // Percentage (10.00%) + self::assertEquals(0.1, $firstSheet->getCell('A2')->getValue()); - $this->assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A4')->getDataType()); // Currency (€10.00) - $this->assertEquals(10, $firstSheet->getCell('A4')->getValue()); + self::assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A4')->getDataType()); // Currency (€10.00) + self::assertEquals(10, $firstSheet->getCell('A4')->getValue()); - $this->assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A5')->getDataType()); // Currency ($20) - $this->assertEquals(20, $firstSheet->getCell('A5')->getValue()); + self::assertEquals(DataType::TYPE_NUMERIC, $firstSheet->getCell('A5')->getDataType()); // Currency ($20) + self::assertEquals(20, $firstSheet->getCell('A5')->getValue()); } public function testReadColors() @@ -161,9 +161,9 @@ class OdsTest extends PHPUnit_Framework_TestCase $style = $firstSheet->getCell('K3')->getStyle(); - $this->assertEquals('none', $style->getFill()->getFillType()); - $this->assertEquals('FFFFFFFF', $style->getFill()->getStartColor()->getARGB()); - $this->assertEquals('FF000000', $style->getFill()->getEndColor()->getARGB()); + self::assertEquals('none', $style->getFill()->getFillType()); + self::assertEquals('FFFFFFFF', $style->getFill()->getStartColor()->getARGB()); + self::assertEquals('FF000000', $style->getFill()->getEndColor()->getARGB()); } public function testReadRichText() @@ -171,7 +171,7 @@ class OdsTest extends PHPUnit_Framework_TestCase $spreadsheet = $this->loadOOCalcTestFile(); $firstSheet = $spreadsheet->getSheet(0); - $this->assertEquals( + self::assertEquals( "I don't know if OOCalc supports Rich Text in the same way as Excel, " . 'And this row should be autofit height with text wrap', $firstSheet->getCell('A28')->getValue() @@ -183,10 +183,10 @@ class OdsTest extends PHPUnit_Framework_TestCase $spreadsheet = $this->loadDataFile(); $firstSheet = $spreadsheet->getSheet(0); - $this->assertEquals('This has 4 spaces before and 2 after ', $firstSheet->getCell('A8')->getValue()); - $this->assertEquals('This only one after ', $firstSheet->getCell('A9')->getValue()); - $this->assertEquals('Test with DIFFERENT styles and multiple spaces: ', $firstSheet->getCell('A10')->getValue()); - $this->assertEquals("test with new \nLines", $firstSheet->getCell('A11')->getValue()); + self::assertEquals('This has 4 spaces before and 2 after ', $firstSheet->getCell('A8')->getValue()); + self::assertEquals('This only one after ', $firstSheet->getCell('A9')->getValue()); + self::assertEquals('Test with DIFFERENT styles and multiple spaces: ', $firstSheet->getCell('A10')->getValue()); + self::assertEquals("test with new \nLines", $firstSheet->getCell('A11')->getValue()); } public function testReadHyperlinks() @@ -196,9 +196,9 @@ class OdsTest extends PHPUnit_Framework_TestCase $hyperlink = $firstSheet->getCell('A29'); - $this->assertEquals(DataType::TYPE_STRING, $hyperlink->getDataType()); - $this->assertEquals('PHPExcel', $hyperlink->getValue()); - $this->assertEquals('http://www.phpexcel.net/', $hyperlink->getHyperlink()->getUrl()); + self::assertEquals(DataType::TYPE_STRING, $hyperlink->getDataType()); + self::assertEquals('PHPExcel', $hyperlink->getValue()); + self::assertEquals('http://www.phpexcel.net/', $hyperlink->getHyperlink()->getUrl()); } /* @@ -215,15 +215,15 @@ class OdsTest extends PHPUnit_Framework_TestCase // Font styles $style = $firstSheet->getCell('A1')->getStyle(); - $this->assertEquals('FF000000', $style->getFont()->getColor()->getARGB()); - $this->assertEquals(11, $style->getFont()->getSize()); - $this->assertEquals(Font::UNDERLINE_NONE, $style->getFont()->getUnderline()); + self::assertEquals('FF000000', $style->getFont()->getColor()->getARGB()); + self::assertEquals(11, $style->getFont()->getSize()); + self::assertEquals(Font::UNDERLINE_NONE, $style->getFont()->getUnderline()); $style = $firstSheet->getCell('E3')->getStyle(); - $this->assertEquals(Font::UNDERLINE_SINGLE, $style->getFont()->getUnderline()); + self::assertEquals(Font::UNDERLINE_SINGLE, $style->getFont()->getUnderline()); $style = $firstSheet->getCell('E1')->getStyle(); - $this->assertTrue($style->getFont()->getBold()); - $this->assertTrue($style->getFont()->getItalic()); + self::assertTrue($style->getFont()->getBold()); + self::assertTrue($style->getFont()->getItalic()); } } diff --git a/tests/PhpSpreadsheetTests/Reader/XEEValidatorTest.php b/tests/PhpSpreadsheetTests/Reader/XEEValidatorTest.php index 13ca9576..7b2ff48a 100644 --- a/tests/PhpSpreadsheetTests/Reader/XEEValidatorTest.php +++ b/tests/PhpSpreadsheetTests/Reader/XEEValidatorTest.php @@ -20,7 +20,7 @@ class XEEValidatorTest extends PHPUnit_Framework_TestCase $reader = $this->getMockForAbstractClass(BaseReader::class); $expectedResult = 'FAILURE: Should throw an Exception rather than return a value'; $result = $reader->securityScanFile($filename); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerInvalidXML() @@ -65,7 +65,7 @@ class XEEValidatorTest extends PHPUnit_Framework_TestCase { $reader = $this->getMockForAbstractClass(BaseReader::class); $result = $reader->securityScanFile($filename); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerValidXML() diff --git a/tests/PhpSpreadsheetTests/ReferenceHelperTest.php b/tests/PhpSpreadsheetTests/ReferenceHelperTest.php index 1f7e0d56..e25f072f 100644 --- a/tests/PhpSpreadsheetTests/ReferenceHelperTest.php +++ b/tests/PhpSpreadsheetTests/ReferenceHelperTest.php @@ -28,7 +28,7 @@ class ReferenceHelperTest extends PHPUnit_Framework_TestCase shuffle($columnBase); usort($columnBase, [ReferenceHelper::class, 'columnSort']); foreach ($columnBase as $key => $value) { - $this->assertEquals($columnExpectedResult[$key], $value); + self::assertEquals($columnExpectedResult[$key], $value); } } @@ -50,7 +50,7 @@ class ReferenceHelperTest extends PHPUnit_Framework_TestCase $columnExpectedResult = array_reverse($columnExpectedResult); usort($columnBase, [ReferenceHelper::class, 'columnReverseSort']); foreach ($columnBase as $key => $value) { - $this->assertEquals($columnExpectedResult[$key], $value); + self::assertEquals($columnExpectedResult[$key], $value); } } } diff --git a/tests/PhpSpreadsheetTests/SettingsTest.php b/tests/PhpSpreadsheetTests/SettingsTest.php index ec0e12ea..2abbe1b4 100644 --- a/tests/PhpSpreadsheetTests/SettingsTest.php +++ b/tests/PhpSpreadsheetTests/SettingsTest.php @@ -26,15 +26,15 @@ class SettingsTest extends PHPUnit_Framework_TestCase public function testGetXMLSettings() { $result = Settings::getLibXmlLoaderOptions(); - $this->assertTrue((bool) ((LIBXML_DTDLOAD | LIBXML_DTDATTR) & $result)); - $this->assertFalse(libxml_disable_entity_loader()); + self::assertTrue((bool) ((LIBXML_DTDLOAD | LIBXML_DTDATTR) & $result)); + self::assertFalse(libxml_disable_entity_loader()); } public function testSetXMLSettings() { Settings::setLibXmlLoaderOptions(LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID); $result = Settings::getLibXmlLoaderOptions(); - $this->assertTrue((bool) ((LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID) & $result)); - $this->assertFalse(libxml_disable_entity_loader()); + self::assertTrue((bool) ((LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID) & $result)); + self::assertFalse(libxml_disable_entity_loader()); } } diff --git a/tests/PhpSpreadsheetTests/Shared/CodePageTest.php b/tests/PhpSpreadsheetTests/Shared/CodePageTest.php index 7841fe98..77009581 100644 --- a/tests/PhpSpreadsheetTests/Shared/CodePageTest.php +++ b/tests/PhpSpreadsheetTests/Shared/CodePageTest.php @@ -16,7 +16,7 @@ class CodePageTest extends PHPUnit_Framework_TestCase public function testCodePageNumberToName($expectedResult, ...$args) { $result = CodePage::numberToName(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerCodePage() @@ -30,7 +30,7 @@ class CodePageTest extends PHPUnit_Framework_TestCase try { CodePage::numberToName($invalidCodePage); } catch (Exception $e) { - $this->assertEquals($e->getMessage(), 'Unknown codepage: 12345'); + self::assertEquals($e->getMessage(), 'Unknown codepage: 12345'); return; } @@ -43,7 +43,7 @@ class CodePageTest extends PHPUnit_Framework_TestCase try { CodePage::numberToName($unsupportedCodePage); } catch (Exception $e) { - $this->assertEquals($e->getMessage(), 'Code page 720 not supported.'); + self::assertEquals($e->getMessage(), 'Code page 720 not supported.'); return; } diff --git a/tests/PhpSpreadsheetTests/Shared/DateTest.php b/tests/PhpSpreadsheetTests/Shared/DateTest.php index 2e6d028d..f6b71b02 100644 --- a/tests/PhpSpreadsheetTests/Shared/DateTest.php +++ b/tests/PhpSpreadsheetTests/Shared/DateTest.php @@ -16,7 +16,7 @@ class DateTest extends PHPUnit_Framework_TestCase foreach ($calendarValues as $calendarValue) { $result = Date::setExcelCalendar($calendarValue); - $this->assertTrue($result); + self::assertTrue($result); } } @@ -24,7 +24,7 @@ class DateTest extends PHPUnit_Framework_TestCase { $unsupportedCalendar = '2012'; $result = Date::setExcelCalendar($unsupportedCalendar); - $this->assertFalse($result); + self::assertFalse($result); } /** @@ -37,7 +37,7 @@ class DateTest extends PHPUnit_Framework_TestCase Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900); $result = Date::excelToTimestamp(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerDateTimeExcelToTimestamp1900() @@ -55,7 +55,7 @@ class DateTest extends PHPUnit_Framework_TestCase Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900); $result = Date::timestampToExcel(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-5); + self::assertEquals($expectedResult, $result, null, 1E-5); } public function providerDateTimeTimestampToExcel1900() @@ -73,7 +73,7 @@ class DateTest extends PHPUnit_Framework_TestCase Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900); $result = Date::dateTimeToExcel(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-5); + self::assertEquals($expectedResult, $result, null, 1E-5); } public function providerDateTimeDateTimeToExcel() @@ -91,7 +91,7 @@ class DateTest extends PHPUnit_Framework_TestCase Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900); $result = Date::formattedPHPToExcel(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-5); + self::assertEquals($expectedResult, $result, null, 1E-5); } public function providerDateTimeFormattedPHPToExcel1900() @@ -109,7 +109,7 @@ class DateTest extends PHPUnit_Framework_TestCase Date::setExcelCalendar(Date::CALENDAR_MAC_1904); $result = Date::excelToTimestamp(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerDateTimeExcelToTimestamp1904() @@ -127,7 +127,7 @@ class DateTest extends PHPUnit_Framework_TestCase Date::setExcelCalendar(Date::CALENDAR_MAC_1904); $result = Date::timestampToExcel(...$args); - $this->assertEquals($expectedResult, $result, null, 1E-5); + self::assertEquals($expectedResult, $result, null, 1E-5); } public function providerDateTimeTimestampToExcel1904() @@ -143,7 +143,7 @@ class DateTest extends PHPUnit_Framework_TestCase public function testIsDateTimeFormatCode($expectedResult, ...$args) { $result = Date::isDateTimeFormatCode(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerIsDateTimeFormatCode() @@ -161,7 +161,7 @@ class DateTest extends PHPUnit_Framework_TestCase Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900); $result = Date::excelToTimestamp(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerDateTimeExcelToTimestamp1900Timezone() diff --git a/tests/PhpSpreadsheetTests/Shared/FileTest.php b/tests/PhpSpreadsheetTests/Shared/FileTest.php index 5f148a2a..65e5959e 100644 --- a/tests/PhpSpreadsheetTests/Shared/FileTest.php +++ b/tests/PhpSpreadsheetTests/Shared/FileTest.php @@ -12,7 +12,7 @@ class FileTest extends PHPUnit_Framework_TestCase $expectedResult = false; $result = File::getUseUploadTempDirectory(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testSetUseUploadTempDirectory() @@ -26,7 +26,7 @@ class FileTest extends PHPUnit_Framework_TestCase File::setUseUploadTempDirectory($useUploadTempDirectoryValue); $result = File::getUseUploadTempDirectory(); - $this->assertEquals($useUploadTempDirectoryValue, $result); + self::assertEquals($useUploadTempDirectoryValue, $result); } } } diff --git a/tests/PhpSpreadsheetTests/Shared/FontTest.php b/tests/PhpSpreadsheetTests/Shared/FontTest.php index 76a40d1c..1f9f215e 100644 --- a/tests/PhpSpreadsheetTests/Shared/FontTest.php +++ b/tests/PhpSpreadsheetTests/Shared/FontTest.php @@ -12,7 +12,7 @@ class FontTest extends PHPUnit_Framework_TestCase $expectedResult = Font::AUTOSIZE_METHOD_APPROX; $result = Font::getAutoSizeMethod(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testSetAutoSizeMethod() @@ -24,7 +24,7 @@ class FontTest extends PHPUnit_Framework_TestCase foreach ($autosizeMethodValues as $autosizeMethodValue) { $result = Font::setAutoSizeMethod($autosizeMethodValue); - $this->assertTrue($result); + self::assertTrue($result); } } @@ -33,7 +33,7 @@ class FontTest extends PHPUnit_Framework_TestCase $unsupportedAutosizeMethod = 'guess'; $result = Font::setAutoSizeMethod($unsupportedAutosizeMethod); - $this->assertFalse($result); + self::assertFalse($result); } /** @@ -44,7 +44,7 @@ class FontTest extends PHPUnit_Framework_TestCase public function testFontSizeToPixels($expectedResult, ...$args) { $result = Font::fontSizeToPixels(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerFontSizeToPixels() @@ -60,7 +60,7 @@ class FontTest extends PHPUnit_Framework_TestCase public function testInchSizeToPixels($expectedResult, ...$args) { $result = Font::inchSizeToPixels(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerInchSizeToPixels() @@ -76,7 +76,7 @@ class FontTest extends PHPUnit_Framework_TestCase public function testCentimeterSizeToPixels($expectedResult, ...$args) { $result = Font::centimeterSizeToPixels(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerCentimeterSizeToPixels() diff --git a/tests/PhpSpreadsheetTests/Shared/PasswordHasherTest.php b/tests/PhpSpreadsheetTests/Shared/PasswordHasherTest.php index 271deefc..880159df 100644 --- a/tests/PhpSpreadsheetTests/Shared/PasswordHasherTest.php +++ b/tests/PhpSpreadsheetTests/Shared/PasswordHasherTest.php @@ -16,7 +16,7 @@ class PasswordHasherTest extends PHPUnit_Framework_TestCase public function testHashPassword($expectedResult, ...$args) { $result = PasswordHasher::hashPassword(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerHashPassword() diff --git a/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php b/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php index 67b82f7e..64e584d9 100644 --- a/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php +++ b/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php @@ -18,7 +18,7 @@ class StringHelperTest extends PHPUnit_Framework_TestCase public function testGetIsIconvEnabled() { $result = StringHelper::getIsIconvEnabled(); - $this->assertTrue($result); + self::assertTrue($result); } public function testGetDecimalSeparator() @@ -27,7 +27,7 @@ class StringHelperTest extends PHPUnit_Framework_TestCase $expectedResult = (!empty($localeconv['decimal_point'])) ? $localeconv['decimal_point'] : ','; $result = StringHelper::getDecimalSeparator(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testSetDecimalSeparator() @@ -36,7 +36,7 @@ class StringHelperTest extends PHPUnit_Framework_TestCase StringHelper::setDecimalSeparator($expectedResult); $result = StringHelper::getDecimalSeparator(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testGetThousandsSeparator() @@ -45,7 +45,7 @@ class StringHelperTest extends PHPUnit_Framework_TestCase $expectedResult = (!empty($localeconv['thousands_sep'])) ? $localeconv['thousands_sep'] : ','; $result = StringHelper::getThousandsSeparator(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testSetThousandsSeparator() @@ -54,7 +54,7 @@ class StringHelperTest extends PHPUnit_Framework_TestCase StringHelper::setThousandsSeparator($expectedResult); $result = StringHelper::getThousandsSeparator(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testGetCurrencyCode() @@ -62,7 +62,7 @@ class StringHelperTest extends PHPUnit_Framework_TestCase $localeconv = localeconv(); $expectedResult = (!empty($localeconv['currency_symbol']) ? $localeconv['currency_symbol'] : (!empty($localeconv['int_curr_symbol']) ? $localeconv['int_curr_symbol'] : '$')); $result = StringHelper::getCurrencyCode(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testSetCurrencyCode() @@ -71,7 +71,7 @@ class StringHelperTest extends PHPUnit_Framework_TestCase StringHelper::setCurrencyCode($expectedResult); $result = StringHelper::getCurrencyCode(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testControlCharacterPHP2OOXML() @@ -79,7 +79,7 @@ class StringHelperTest extends PHPUnit_Framework_TestCase $expectedResult = 'foo_x000B_bar'; $result = StringHelper::controlCharacterPHP2OOXML('foo' . chr(11) . 'bar'); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testControlCharacterOOXML2PHP() @@ -87,7 +87,7 @@ class StringHelperTest extends PHPUnit_Framework_TestCase $expectedResult = 'foo' . chr(11) . 'bar'; $result = StringHelper::controlCharacterOOXML2PHP('foo_x000B_bar'); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testSYLKtoUTF8() @@ -95,6 +95,6 @@ class StringHelperTest extends PHPUnit_Framework_TestCase $expectedResult = 'foo' . chr(11) . 'bar'; $result = StringHelper::SYLKtoUTF8("foo\x1B ;bar"); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } } diff --git a/tests/PhpSpreadsheetTests/Shared/TimeZoneTest.php b/tests/PhpSpreadsheetTests/Shared/TimeZoneTest.php index 706955c2..ddddade6 100644 --- a/tests/PhpSpreadsheetTests/Shared/TimeZoneTest.php +++ b/tests/PhpSpreadsheetTests/Shared/TimeZoneTest.php @@ -19,7 +19,7 @@ class TimeZoneTest extends PHPUnit_Framework_TestCase foreach ($timezoneValues as $timezoneValue) { $result = TimeZone::setTimezone($timezoneValue); - $this->assertTrue($result); + self::assertTrue($result); } } @@ -27,6 +27,6 @@ class TimeZoneTest extends PHPUnit_Framework_TestCase { $unsupportedTimezone = 'Etc/GMT+10'; $result = TimeZone::setTimezone($unsupportedTimezone); - $this->assertFalse($result); + self::assertFalse($result); } } diff --git a/tests/PhpSpreadsheetTests/Style/BorderTest.php b/tests/PhpSpreadsheetTests/Style/BorderTest.php index 4055c870..7f772e90 100644 --- a/tests/PhpSpreadsheetTests/Style/BorderTest.php +++ b/tests/PhpSpreadsheetTests/Style/BorderTest.php @@ -16,11 +16,11 @@ class BorderTest extends PHPUnit_Framework_TestCase $bottom = $borders->getBottom(); $actual = $bottom->getBorderStyle(); - $this->assertSame(Border::BORDER_NONE, $actual, 'should default to none'); + self::assertSame(Border::BORDER_NONE, $actual, 'should default to none'); $allBorders->setBorderStyle(Border::BORDER_THIN); $actual = $bottom->getBorderStyle(); - $this->assertSame(Border::BORDER_THIN, $actual, 'should have been set via allBorders'); + self::assertSame(Border::BORDER_THIN, $actual, 'should have been set via allBorders'); } } diff --git a/tests/PhpSpreadsheetTests/Style/ColorTest.php b/tests/PhpSpreadsheetTests/Style/ColorTest.php index 6ed161d2..26ff0f6f 100644 --- a/tests/PhpSpreadsheetTests/Style/ColorTest.php +++ b/tests/PhpSpreadsheetTests/Style/ColorTest.php @@ -15,7 +15,7 @@ class ColorTest extends PHPUnit_Framework_TestCase public function testGetRed($expectedResult, ...$args) { $result = Color::getRed(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerColorGetRed() @@ -31,7 +31,7 @@ class ColorTest extends PHPUnit_Framework_TestCase public function testGetGreen($expectedResult, ...$args) { $result = Color::getGreen(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerColorGetGreen() @@ -47,7 +47,7 @@ class ColorTest extends PHPUnit_Framework_TestCase public function testGetBlue($expectedResult, ...$args) { $result = Color::getBlue(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerColorGetBlue() @@ -63,7 +63,7 @@ class ColorTest extends PHPUnit_Framework_TestCase public function testChangeBrightness($expectedResult, ...$args) { $result = Color::changeBrightness(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerColorChangeBrightness() diff --git a/tests/PhpSpreadsheetTests/Style/NumberFormatDateTest.php b/tests/PhpSpreadsheetTests/Style/NumberFormatDateTest.php index af462e41..c9cc3d00 100644 --- a/tests/PhpSpreadsheetTests/Style/NumberFormatDateTest.php +++ b/tests/PhpSpreadsheetTests/Style/NumberFormatDateTest.php @@ -22,7 +22,7 @@ class NumberFormatDateTest extends PHPUnit_Framework_TestCase public function testFormatValueWithMask($expectedResult, ...$args) { $result = NumberFormat::toFormattedString(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerNumberFormat() diff --git a/tests/PhpSpreadsheetTests/Style/NumberFormatTest.php b/tests/PhpSpreadsheetTests/Style/NumberFormatTest.php index 72c7fbe4..f0b5647a 100644 --- a/tests/PhpSpreadsheetTests/Style/NumberFormatTest.php +++ b/tests/PhpSpreadsheetTests/Style/NumberFormatTest.php @@ -22,7 +22,7 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase public function testFormatValueWithMask($expectedResult, ...$args) { $result = NumberFormat::toFormattedString(...$args); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function providerNumberFormat() diff --git a/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/Column/RuleTest.php b/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/Column/RuleTest.php index b7760e25..a93ed360 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/Column/RuleTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/Column/RuleTest.php @@ -24,7 +24,7 @@ class RuleTest extends PHPUnit_Framework_TestCase public function testGetRuleType() { $result = $this->testAutoFilterRuleObject->getRuleType(); - $this->assertEquals(Column\Rule::AUTOFILTER_RULETYPE_FILTER, $result); + self::assertEquals(Column\Rule::AUTOFILTER_RULETYPE_FILTER, $result); } public function testSetRuleType() @@ -33,10 +33,10 @@ class RuleTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterRuleObject->setRuleType($expectedResult); - $this->assertInstanceOf(Column\Rule::class, $result); + self::assertInstanceOf(Column\Rule::class, $result); $result = $this->testAutoFilterRuleObject->getRuleType(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testSetValue() @@ -45,16 +45,16 @@ class RuleTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterRuleObject->setValue($expectedResult); - $this->assertInstanceOf(Column\Rule::class, $result); + self::assertInstanceOf(Column\Rule::class, $result); $result = $this->testAutoFilterRuleObject->getValue(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testGetOperator() { $result = $this->testAutoFilterRuleObject->getOperator(); - $this->assertEquals(Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, $result); + self::assertEquals(Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, $result); } public function testSetOperator() @@ -63,10 +63,10 @@ class RuleTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterRuleObject->setOperator($expectedResult); - $this->assertInstanceOf(Column\Rule::class, $result); + self::assertInstanceOf(Column\Rule::class, $result); $result = $this->testAutoFilterRuleObject->getOperator(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testSetGrouping() @@ -75,28 +75,28 @@ class RuleTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterRuleObject->setGrouping($expectedResult); - $this->assertInstanceOf(Column\Rule::class, $result); + self::assertInstanceOf(Column\Rule::class, $result); $result = $this->testAutoFilterRuleObject->getGrouping(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testGetParent() { $result = $this->testAutoFilterRuleObject->getParent(); - $this->assertInstanceOf(Column::class, $result); + self::assertInstanceOf(Column::class, $result); } public function testSetParent() { // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterRuleObject->setParent($this->mockAutoFilterColumnObject); - $this->assertInstanceOf(Column\Rule::class, $result); + self::assertInstanceOf(Column\Rule::class, $result); } public function testClone() { $result = clone $this->testAutoFilterRuleObject; - $this->assertInstanceOf(Column\Rule::class, $result); + self::assertInstanceOf(Column\Rule::class, $result); } } diff --git a/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php b/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php index e171e814..cf9944fc 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php @@ -27,7 +27,7 @@ class ColumnTest extends PHPUnit_Framework_TestCase public function testGetColumnIndex() { $result = $this->testAutoFilterColumnObject->getColumnIndex(); - $this->assertEquals($this->testInitialColumn, $result); + self::assertEquals($this->testInitialColumn, $result); } public function testSetColumnIndex() @@ -36,38 +36,38 @@ class ColumnTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterColumnObject->setColumnIndex($expectedResult); - $this->assertInstanceOf(AutoFilter\Column::class, $result); + self::assertInstanceOf(AutoFilter\Column::class, $result); $result = $this->testAutoFilterColumnObject->getColumnIndex(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testGetParent() { $result = $this->testAutoFilterColumnObject->getParent(); - $this->assertInstanceOf(AutoFilter::class, $result); + self::assertInstanceOf(AutoFilter::class, $result); } public function testSetParent() { // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterColumnObject->setParent($this->mockAutoFilterObject); - $this->assertInstanceOf(AutoFilter\Column::class, $result); + self::assertInstanceOf(AutoFilter\Column::class, $result); } public function testGetFilterType() { $result = $this->testAutoFilterColumnObject->getFilterType(); - $this->assertEquals(AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER, $result); + self::assertEquals(AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER, $result); } public function testSetFilterType() { $result = $this->testAutoFilterColumnObject->setFilterType(AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); - $this->assertInstanceOf(AutoFilter\Column::class, $result); + self::assertInstanceOf(AutoFilter\Column::class, $result); $result = $this->testAutoFilterColumnObject->getFilterType(); - $this->assertEquals(AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER, $result); + self::assertEquals(AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER, $result); } /** @@ -83,16 +83,16 @@ class ColumnTest extends PHPUnit_Framework_TestCase public function testGetJoin() { $result = $this->testAutoFilterColumnObject->getJoin(); - $this->assertEquals(AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_OR, $result); + self::assertEquals(AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_OR, $result); } public function testSetJoin() { $result = $this->testAutoFilterColumnObject->setJoin(AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND); - $this->assertInstanceOf(AutoFilter\Column::class, $result); + self::assertInstanceOf(AutoFilter\Column::class, $result); $result = $this->testAutoFilterColumnObject->getJoin(); - $this->assertEquals(AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND, $result); + self::assertEquals(AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND, $result); } /** @@ -114,7 +114,7 @@ class ColumnTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterColumnObject->setAttributes($attributeSet); - $this->assertInstanceOf(AutoFilter\Column::class, $result); + self::assertInstanceOf(AutoFilter\Column::class, $result); } public function testGetAttributes() @@ -127,8 +127,8 @@ class ColumnTest extends PHPUnit_Framework_TestCase $this->testAutoFilterColumnObject->setAttributes($attributeSet); $result = $this->testAutoFilterColumnObject->getAttributes(); - $this->assertInternalType('array', $result); - $this->assertCount(count($attributeSet), $result); + self::assertInternalType('array', $result); + self::assertCount(count($attributeSet), $result); } public function testSetAttribute() @@ -141,7 +141,7 @@ class ColumnTest 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(AutoFilter\Column::class, $result); + self::assertInstanceOf(AutoFilter\Column::class, $result); } } @@ -156,21 +156,21 @@ class ColumnTest extends PHPUnit_Framework_TestCase foreach ($attributeSet as $attributeName => $attributeValue) { $result = $this->testAutoFilterColumnObject->getAttribute($attributeName); - $this->assertEquals($attributeValue, $result); + self::assertEquals($attributeValue, $result); } $result = $this->testAutoFilterColumnObject->getAttribute('nonExistentAttribute'); - $this->assertNull($result); + self::assertNull($result); } public function testClone() { $originalRule = $this->testAutoFilterColumnObject->createRule(); $result = clone $this->testAutoFilterColumnObject; - $this->assertInstanceOf(AutoFilter\Column::class, $result); - $this->assertCount(1, $result->getRules()); - $this->assertContainsOnlyInstancesOf(AutoFilter\Column\Rule::class, $result->getRules()); + self::assertInstanceOf(AutoFilter\Column::class, $result); + self::assertCount(1, $result->getRules()); + self::assertContainsOnlyInstancesOf(AutoFilter\Column\Rule::class, $result->getRules()); $clonedRule = $result->getRules()[0]; - $this->assertNotSame($originalRule, $clonedRule); - $this->assertSame($result, $clonedRule->getParent()); + self::assertNotSame($originalRule, $clonedRule); + self::assertSame($result, $clonedRule->getParent()); } } diff --git a/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php b/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php index 974dbd70..3a922420 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php @@ -36,20 +36,20 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase // magic __toString should return the active autofilter range $result = $this->testAutoFilterObject; - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testGetParent() { $result = $this->testAutoFilterObject->getParent(); - $this->assertInstanceOf(Worksheet::class, $result); + self::assertInstanceOf(Worksheet::class, $result); } public function testSetParent() { // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterObject->setParent($this->mockWorksheetObject); - $this->assertInstanceOf(AutoFilter::class, $result); + self::assertInstanceOf(AutoFilter::class, $result); } public function testGetRange() @@ -58,7 +58,7 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase // Result should be the active autofilter range $result = $this->testAutoFilterObject->getRange(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testSetRange() @@ -71,11 +71,11 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase foreach ($ranges as $actualRange => $fullRange) { // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterObject->setRange($fullRange); - $this->assertInstanceOf(AutoFilter::class, $result); + self::assertInstanceOf(AutoFilter::class, $result); // Result should be the new autofilter range $result = $this->testAutoFilterObject->getRange(); - $this->assertEquals($actualRange, $result); + self::assertEquals($actualRange, $result); } } @@ -85,11 +85,11 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterObject->setRange(''); - $this->assertInstanceOf(AutoFilter::class, $result); + self::assertInstanceOf(AutoFilter::class, $result); // Result should be a clear range $result = $this->testAutoFilterObject->getRange(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } /** @@ -106,8 +106,8 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase { // There should be no columns yet defined $result = $this->testAutoFilterObject->getColumns(); - $this->assertInternalType('array', $result); - $this->assertCount(0, $result); + self::assertInternalType('array', $result); + self::assertCount(0, $result); } public function testGetColumnOffset() @@ -122,7 +122,7 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase // integer returned representing the column offset within the range foreach ($columnIndexes as $columnIndex => $columnOffset) { $result = $this->testAutoFilterObject->getColumnOffset($columnIndex); - $this->assertEquals($columnOffset, $result); + self::assertEquals($columnOffset, $result); } } @@ -142,15 +142,15 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterObject->setColumn($expectedResult); - $this->assertInstanceOf(AutoFilter::class, $result); + self::assertInstanceOf(AutoFilter::class, $result); $result = $this->testAutoFilterObject->getColumns(); // Result should be an array of \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column // objects for each column we set indexed by the column ID - $this->assertInternalType('array', $result); - $this->assertCount(1, $result); - $this->assertArrayHasKey($expectedResult, $result); - $this->assertInstanceOf(Column::class, $result[$expectedResult]); + self::assertInternalType('array', $result); + self::assertCount(1, $result); + self::assertArrayHasKey($expectedResult, $result); + self::assertInstanceOf(Column::class, $result[$expectedResult]); } /** @@ -170,15 +170,15 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterObject->setColumn($columnObject); - $this->assertInstanceOf(AutoFilter::class, $result); + self::assertInstanceOf(AutoFilter::class, $result); $result = $this->testAutoFilterObject->getColumns(); // Result should be an array of \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column // objects for each column we set indexed by the column ID - $this->assertInternalType('array', $result); - $this->assertCount(1, $result); - $this->assertArrayHasKey($expectedResult, $result); - $this->assertInstanceOf(Column::class, $result[$expectedResult]); + self::assertInternalType('array', $result); + self::assertCount(1, $result); + self::assertArrayHasKey($expectedResult, $result); + self::assertInstanceOf(Column::class, $result[$expectedResult]); } /** @@ -214,11 +214,11 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase $result = $this->testAutoFilterObject->getColumns(); // Result should be an array of \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column // objects for each column we set indexed by the column ID - $this->assertInternalType('array', $result); - $this->assertCount(count($columnIndexes), $result); + self::assertInternalType('array', $result); + self::assertCount(count($columnIndexes), $result); foreach ($columnIndexes as $columnIndex) { - $this->assertArrayHasKey($columnIndex, $result); - $this->assertInstanceOf(Column::class, $result[$columnIndex]); + self::assertArrayHasKey($columnIndex, $result); + self::assertInstanceOf(Column::class, $result[$columnIndex]); } } @@ -234,7 +234,7 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase // get a \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column object returned foreach ($columnIndexes as $columnIndex) { $result = $this->testAutoFilterObject->getColumn($columnIndex); - $this->assertInstanceOf(Column::class, $result); + self::assertInstanceOf(Column::class, $result); } } @@ -250,8 +250,8 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase // get a \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column object returned foreach ($columnIndexes as $columnIndex => $columnID) { $result = $this->testAutoFilterObject->getColumnByOffset($columnIndex); - $this->assertInstanceOf(Column::class, $result); - $this->assertEquals($result->getColumnIndex(), $columnID); + self::assertInstanceOf(Column::class, $result); + self::assertEquals($result->getColumnIndex(), $columnID); } } @@ -260,7 +260,7 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase // If we request a specific column by its column ID, we should // get a \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column object returned $result = $this->testAutoFilterObject->getColumn('K'); - $this->assertInstanceOf(Column::class, $result); + self::assertInstanceOf(Column::class, $result); } /** @@ -284,16 +284,16 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterObject->setRange(''); - $this->assertInstanceOf(AutoFilter::class, $result); + self::assertInstanceOf(AutoFilter::class, $result); // Range should be cleared $result = $this->testAutoFilterObject->getRange(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); // Column array should be cleared $result = $this->testAutoFilterObject->getColumns(); - $this->assertInternalType('array', $result); - $this->assertCount(0, $result); + self::assertInternalType('array', $result); + self::assertCount(0, $result); } public function testSetRangeWithExistingColumns() @@ -313,17 +313,17 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase // Setters return the instance to implement the fluent interface $result = $this->testAutoFilterObject->setRange($expectedResult); - $this->assertInstanceOf(AutoFilter::class, $result); + self::assertInstanceOf(AutoFilter::class, $result); // Range should be correctly set $result = $this->testAutoFilterObject->getRange(); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); // Only columns that existed in the original range and that // still fall within the new range should be retained $result = $this->testAutoFilterObject->getColumns(); - $this->assertInternalType('array', $result); - $this->assertCount(count($columnIndexes1), $result); + self::assertInternalType('array', $result); + self::assertCount(count($columnIndexes1), $result); } public function testClone() @@ -335,6 +335,6 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase } $result = clone $this->testAutoFilterObject; - $this->assertInstanceOf(AutoFilter::class, $result); + self::assertInstanceOf(AutoFilter::class, $result); } } diff --git a/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php b/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php index 5af397a5..20e71d81 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php @@ -34,11 +34,11 @@ class ColumnCellIteratorTest extends PHPUnit_Framework_TestCase { $iterator = new ColumnCellIterator($this->mockWorksheet, 'A'); $ColumnCellIndexResult = 1; - $this->assertEquals($ColumnCellIndexResult, $iterator->key()); + self::assertEquals($ColumnCellIndexResult, $iterator->key()); foreach ($iterator as $key => $ColumnCell) { - $this->assertEquals($ColumnCellIndexResult++, $key); - $this->assertInstanceOf(Cell::class, $ColumnCell); + self::assertEquals($ColumnCellIndexResult++, $key); + self::assertInstanceOf(Cell::class, $ColumnCell); } } @@ -46,11 +46,11 @@ class ColumnCellIteratorTest extends PHPUnit_Framework_TestCase { $iterator = new ColumnCellIterator($this->mockWorksheet, 'A', 2, 4); $ColumnCellIndexResult = 2; - $this->assertEquals($ColumnCellIndexResult, $iterator->key()); + self::assertEquals($ColumnCellIndexResult, $iterator->key()); foreach ($iterator as $key => $ColumnCell) { - $this->assertEquals($ColumnCellIndexResult++, $key); - $this->assertInstanceOf(Cell::class, $ColumnCell); + self::assertEquals($ColumnCellIndexResult++, $key); + self::assertInstanceOf(Cell::class, $ColumnCell); } } @@ -59,11 +59,11 @@ class ColumnCellIteratorTest extends PHPUnit_Framework_TestCase $iterator = new ColumnCellIterator($this->mockWorksheet, 'A', 2, 4); $columnIndexResult = 4; $iterator->seek(4); - $this->assertEquals($columnIndexResult, $iterator->key()); + self::assertEquals($columnIndexResult, $iterator->key()); for ($i = 1; $i < $columnIndexResult - 1; ++$i) { $iterator->prev(); - $this->assertEquals($columnIndexResult - $i, $iterator->key()); + self::assertEquals($columnIndexResult - $i, $iterator->key()); } } diff --git a/tests/PhpSpreadsheetTests/Worksheet/ColumnIteratorTest.php b/tests/PhpSpreadsheetTests/Worksheet/ColumnIteratorTest.php index 3f107f45..0736fb16 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/ColumnIteratorTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/ColumnIteratorTest.php @@ -31,11 +31,11 @@ class ColumnIteratorTest extends PHPUnit_Framework_TestCase { $iterator = new ColumnIterator($this->mockWorksheet); $columnIndexResult = 'A'; - $this->assertEquals($columnIndexResult, $iterator->key()); + self::assertEquals($columnIndexResult, $iterator->key()); foreach ($iterator as $key => $column) { - $this->assertEquals($columnIndexResult++, $key); - $this->assertInstanceOf(Column::class, $column); + self::assertEquals($columnIndexResult++, $key); + self::assertInstanceOf(Column::class, $column); } } @@ -43,11 +43,11 @@ class ColumnIteratorTest extends PHPUnit_Framework_TestCase { $iterator = new ColumnIterator($this->mockWorksheet, 'B', 'D'); $columnIndexResult = 'B'; - $this->assertEquals($columnIndexResult, $iterator->key()); + self::assertEquals($columnIndexResult, $iterator->key()); foreach ($iterator as $key => $column) { - $this->assertEquals($columnIndexResult++, $key); - $this->assertInstanceOf(Column::class, $column); + self::assertEquals($columnIndexResult++, $key); + self::assertInstanceOf(Column::class, $column); } } @@ -57,12 +57,12 @@ class ColumnIteratorTest extends PHPUnit_Framework_TestCase $iterator = new ColumnIterator($this->mockWorksheet, 'B', 'D'); $columnIndexResult = 'D'; $iterator->seek('D'); - $this->assertEquals($columnIndexResult, $iterator->key()); + self::assertEquals($columnIndexResult, $iterator->key()); for ($i = 1; $i < array_search($columnIndexResult, $ranges); ++$i) { $iterator->prev(); $expectedResult = $ranges[array_search($columnIndexResult, $ranges) - $i]; - $this->assertEquals($expectedResult, $iterator->key()); + self::assertEquals($expectedResult, $iterator->key()); } } diff --git a/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php b/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php index edb76a55..7a040862 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php @@ -34,11 +34,11 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase { $iterator = new RowCellIterator($this->mockWorksheet); $RowCellIndexResult = 'A'; - $this->assertEquals($RowCellIndexResult, $iterator->key()); + self::assertEquals($RowCellIndexResult, $iterator->key()); foreach ($iterator as $key => $RowCell) { - $this->assertEquals($RowCellIndexResult++, $key); - $this->assertInstanceOf(Cell::class, $RowCell); + self::assertEquals($RowCellIndexResult++, $key); + self::assertInstanceOf(Cell::class, $RowCell); } } @@ -46,11 +46,11 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase { $iterator = new RowCellIterator($this->mockWorksheet, 2, 'B', 'D'); $RowCellIndexResult = 'B'; - $this->assertEquals($RowCellIndexResult, $iterator->key()); + self::assertEquals($RowCellIndexResult, $iterator->key()); foreach ($iterator as $key => $RowCell) { - $this->assertEquals($RowCellIndexResult++, $key); - $this->assertInstanceOf(Cell::class, $RowCell); + self::assertEquals($RowCellIndexResult++, $key); + self::assertInstanceOf(Cell::class, $RowCell); } } @@ -60,12 +60,12 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase $iterator = new RowCellIterator($this->mockWorksheet, 2, 'B', 'D'); $RowCellIndexResult = 'D'; $iterator->seek('D'); - $this->assertEquals($RowCellIndexResult, $iterator->key()); + self::assertEquals($RowCellIndexResult, $iterator->key()); for ($i = 1; $i < array_search($RowCellIndexResult, $ranges); ++$i) { $iterator->prev(); $expectedResult = $ranges[array_search($RowCellIndexResult, $ranges) - $i]; - $this->assertEquals($expectedResult, $iterator->key()); + self::assertEquals($expectedResult, $iterator->key()); } } diff --git a/tests/PhpSpreadsheetTests/Worksheet/RowIteratorTest.php b/tests/PhpSpreadsheetTests/Worksheet/RowIteratorTest.php index 071baf7d..629f66e0 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/RowIteratorTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/RowIteratorTest.php @@ -31,11 +31,11 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase { $iterator = new RowIterator($this->mockWorksheet); $rowIndexResult = 1; - $this->assertEquals($rowIndexResult, $iterator->key()); + self::assertEquals($rowIndexResult, $iterator->key()); foreach ($iterator as $key => $row) { - $this->assertEquals($rowIndexResult++, $key); - $this->assertInstanceOf(Row::class, $row); + self::assertEquals($rowIndexResult++, $key); + self::assertInstanceOf(Row::class, $row); } } @@ -43,11 +43,11 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase { $iterator = new RowIterator($this->mockWorksheet, 2, 4); $rowIndexResult = 2; - $this->assertEquals($rowIndexResult, $iterator->key()); + self::assertEquals($rowIndexResult, $iterator->key()); foreach ($iterator as $key => $row) { - $this->assertEquals($rowIndexResult++, $key); - $this->assertInstanceOf(Row::class, $row); + self::assertEquals($rowIndexResult++, $key); + self::assertInstanceOf(Row::class, $row); } } @@ -56,11 +56,11 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase $iterator = new RowIterator($this->mockWorksheet, 2, 4); $columnIndexResult = 4; $iterator->seek(4); - $this->assertEquals($columnIndexResult, $iterator->key()); + self::assertEquals($columnIndexResult, $iterator->key()); for ($i = 1; $i < $columnIndexResult - 1; ++$i) { $iterator->prev(); - $this->assertEquals($columnIndexResult - $i, $iterator->key()); + self::assertEquals($columnIndexResult - $i, $iterator->key()); } } diff --git a/tests/PhpSpreadsheetTests/Worksheet/WorksheetColumnTest.php b/tests/PhpSpreadsheetTests/Worksheet/WorksheetColumnTest.php index c8730e25..56514fa5 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/WorksheetColumnTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/WorksheetColumnTest.php @@ -25,23 +25,23 @@ class WorksheetColumnTest extends PHPUnit_Framework_TestCase public function testInstantiateColumnDefault() { $column = new Column($this->mockWorksheet); - $this->assertInstanceOf(Column::class, $column); + self::assertInstanceOf(Column::class, $column); $columnIndex = $column->getColumnIndex(); - $this->assertEquals('A', $columnIndex); + self::assertEquals('A', $columnIndex); } public function testInstantiateColumnSpecified() { $column = new Column($this->mockWorksheet, 'E'); - $this->assertInstanceOf(Column::class, $column); + self::assertInstanceOf(Column::class, $column); $columnIndex = $column->getColumnIndex(); - $this->assertEquals('E', $columnIndex); + self::assertEquals('E', $columnIndex); } public function testGetCellIterator() { $column = new Column($this->mockWorksheet); $cellIterator = $column->getCellIterator(); - $this->assertInstanceOf(ColumnCellIterator::class, $cellIterator); + self::assertInstanceOf(ColumnCellIterator::class, $cellIterator); } } diff --git a/tests/PhpSpreadsheetTests/Worksheet/WorksheetRowTest.php b/tests/PhpSpreadsheetTests/Worksheet/WorksheetRowTest.php index d16149fb..e81f821e 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/WorksheetRowTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/WorksheetRowTest.php @@ -25,23 +25,23 @@ class WorksheetRowTest extends PHPUnit_Framework_TestCase public function testInstantiateRowDefault() { $row = new Row($this->mockWorksheet); - $this->assertInstanceOf(Row::class, $row); + self::assertInstanceOf(Row::class, $row); $rowIndex = $row->getRowIndex(); - $this->assertEquals(1, $rowIndex); + self::assertEquals(1, $rowIndex); } public function testInstantiateRowSpecified() { $row = new Row($this->mockWorksheet, 5); - $this->assertInstanceOf(Row::class, $row); + self::assertInstanceOf(Row::class, $row); $rowIndex = $row->getRowIndex(); - $this->assertEquals(5, $rowIndex); + self::assertEquals(5, $rowIndex); } public function testGetCellIterator() { $row = new Row($this->mockWorksheet); $cellIterator = $row->getCellIterator(); - $this->assertInstanceOf(RowCellIterator::class, $cellIterator); + self::assertInstanceOf(RowCellIterator::class, $cellIterator); } } diff --git a/tests/PhpSpreadsheetTests/WorksheetTest.php b/tests/PhpSpreadsheetTests/WorksheetTest.php index 1a7389b0..5605fc81 100644 --- a/tests/PhpSpreadsheetTests/WorksheetTest.php +++ b/tests/PhpSpreadsheetTests/WorksheetTest.php @@ -14,7 +14,7 @@ class WorksheetTest extends PHPUnit_Framework_TestCase $worksheet = new Worksheet(); $worksheet->setTitle($testTitle); - $this->assertSame($testTitle, $worksheet->getTitle()); + self::assertSame($testTitle, $worksheet->getTitle()); } public function setTitleInvalidProvider() @@ -53,17 +53,17 @@ class WorksheetTest extends PHPUnit_Framework_TestCase // Set unique title -- should be unchanged $sheet = $spreadsheet->getSheet(0); $sheet->setTitle('Test Title'); - $this->assertSame('Test Title', $sheet->getTitle()); + self::assertSame('Test Title', $sheet->getTitle()); // Set duplicate title -- should have numeric suffix appended $sheet = $spreadsheet->getSheet(1); $sheet->setTitle('Test Title'); - $this->assertSame('Test Title 1', $sheet->getTitle()); + self::assertSame('Test Title 1', $sheet->getTitle()); // Set duplicate title with validation disabled -- should be unchanged $sheet = $spreadsheet->getSheet(2); $sheet->setTitle('Test Title', true, false); - $this->assertSame('Test Title', $sheet->getTitle()); + self::assertSame('Test Title', $sheet->getTitle()); } public function testSetCodeName() @@ -72,7 +72,7 @@ class WorksheetTest extends PHPUnit_Framework_TestCase $worksheet = new Worksheet(); $worksheet->setCodeName($testCodeName); - $this->assertSame($testCodeName, $worksheet->getCodeName()); + self::assertSame($testCodeName, $worksheet->getCodeName()); } public function setCodeNameInvalidProvider() @@ -111,16 +111,16 @@ class WorksheetTest extends PHPUnit_Framework_TestCase // Set unique code name -- should be massaged to Snake_Case $sheet = $spreadsheet->getSheet(0); $sheet->setCodeName('Test Code Name'); - $this->assertSame('Test_Code_Name', $sheet->getCodeName()); + self::assertSame('Test_Code_Name', $sheet->getCodeName()); // Set duplicate code name -- should be massaged and have numeric suffix appended $sheet = $spreadsheet->getSheet(1); $sheet->setCodeName('Test Code Name'); - $this->assertSame('Test_Code_Name_1', $sheet->getCodeName()); + self::assertSame('Test_Code_Name_1', $sheet->getCodeName()); // Set duplicate code name with validation disabled -- should be unchanged, and unmassaged $sheet = $spreadsheet->getSheet(2); $sheet->setCodeName('Test Code Name', false); - $this->assertSame('Test Code Name', $sheet->getCodeName()); + self::assertSame('Test Code Name', $sheet->getCodeName()); } } diff --git a/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php b/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php index 00cf5cc5..87bd7310 100644 --- a/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php @@ -42,7 +42,7 @@ class ContentTest extends PHPUnit_Framework_TestCase $content = new Content(new Ods(new Spreadsheet())); $xml = $content->write(); - $this->assertXmlStringEqualsXmlFile($this->samplesPath . '/content-empty.xml', $xml); + self::assertXmlStringEqualsXmlFile($this->samplesPath . '/content-empty.xml', $xml); } public function testWriteSpreadsheet() @@ -93,6 +93,6 @@ class ContentTest extends PHPUnit_Framework_TestCase $content = new Content(new Ods($workbook)); $xml = $content->write(); - $this->assertXmlStringEqualsXmlFile($this->samplesPath . '/content-with-data.xml', $xml); + self::assertXmlStringEqualsXmlFile($this->samplesPath . '/content-with-data.xml', $xml); } } diff --git a/tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php b/tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php index 72c2f470..0fd9dbad 100644 --- a/tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php @@ -46,7 +46,7 @@ class WorkbookTest extends PHPUnit_Framework_TestCase $palette = $propertyPalette->getValue($this->workbook); - $this->assertEquals($expectedResult, $palette); + self::assertEquals($expectedResult, $palette); } public function providerAddColor()