diff --git a/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php b/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php index 86ca7a3e..4b81fbf4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php @@ -52,7 +52,7 @@ class CalculationTest extends TestCase */ public function testGetFunctions($category, $functionCall, $argumentCount) { - self::assertInternalType('callable', $functionCall); + self::assertIsCallable($functionCall); } public function providerGetFunctions() diff --git a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php index 1ea22443..003ef206 100644 --- a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php @@ -970,25 +970,25 @@ class EngineeringTest extends TestCase public function testGetConversionGroups() { $result = Engineering::getConversionGroups(); - self::assertInternalType('array', $result); + self::assertIsArray($result); } public function testGetConversionGroupUnits() { $result = Engineering::getConversionGroupUnits(); - self::assertInternalType('array', $result); + self::assertIsArray($result); } public function testGetConversionGroupUnitDetails() { $result = Engineering::getConversionGroupUnitDetails(); - self::assertInternalType('array', $result); + self::assertIsArray($result); } public function testGetConversionMultipliers() { $result = Engineering::getConversionMultipliers(); - self::assertInternalType('array', $result); + self::assertIsArray($result); } /** diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php index 08587336..6628322a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php @@ -49,7 +49,7 @@ class DateTest extends TestCase $result = DateTime::DATE(2012, 1, 31); // Must return an object... - $this->assertInternalType('object', $result); + self::assertIsObject($result); // ... of the correct type $this->assertTrue(is_a($result, 'DateTimeInterface')); // ... with the correct value diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php index 937fc10a..2c4e96eb 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php @@ -2,6 +2,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\DateTime; +use DateTimeInterface; use PhpOffice\PhpSpreadsheet\Calculation\DateTime; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Date; @@ -47,9 +48,9 @@ class DateValueTest extends TestCase $result = DateTime::DATEVALUE('2012-1-31'); // Must return an object... - $this->assertInternalType('object', $result); + self::assertIsObject($result); // ... of the correct type - $this->assertTrue(is_a($result, 'DateTimeInterface')); + $this->assertTrue(is_a($result, DateTimeInterface::class)); // ... with the correct value $this->assertEquals($result->format('d-M-Y'), '31-Jan-2012'); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EDateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EDateTest.php index 74c4a388..7f885096 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EDateTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EDateTest.php @@ -48,7 +48,7 @@ class EDateTest extends TestCase $result = DateTime::EDATE('2012-1-26', -1); // Must return an object... - $this->assertInternalType('object', $result); + self::assertIsObject($result); // ... of the correct type $this->assertTrue(is_a($result, 'DateTimeInterface')); // ... with the correct value diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EoMonthTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EoMonthTest.php index edb9d7ed..6092151a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EoMonthTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EoMonthTest.php @@ -48,7 +48,7 @@ class EoMonthTest extends TestCase $result = DateTime::EOMONTH('2012-1-26', -1); // Must return an object... - $this->assertInternalType('object', $result); + self::assertIsObject($result); // ... of the correct type $this->assertTrue(is_a($result, 'DateTimeInterface')); // ... with the correct value diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeTest.php index 5a0f3b00..61406f5a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeTest.php @@ -46,7 +46,7 @@ class TimeTest extends TestCase $result = DateTime::TIME(7, 30, 20); // Must return an object... - $this->assertInternalType('object', $result); + self::assertIsObject($result); // ... of the correct type $this->assertTrue(is_a($result, 'DateTimeInterface')); // ... with the correct value diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php index 6a45f6a3..4fc09a2d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php @@ -46,7 +46,7 @@ class TimeValueTest extends TestCase $result = DateTime::TIMEVALUE('7:30:20'); // Must return an object... - $this->assertInternalType('object', $result); + self::assertIsObject($result); // ... of the correct type $this->assertTrue(is_a($result, 'DateTimeInterface')); // ... with the correct value diff --git a/tests/PhpSpreadsheetTests/Cell/DataTypeTest.php b/tests/PhpSpreadsheetTests/Cell/DataTypeTest.php index c450e6e1..1e1b5ecc 100644 --- a/tests/PhpSpreadsheetTests/Cell/DataTypeTest.php +++ b/tests/PhpSpreadsheetTests/Cell/DataTypeTest.php @@ -10,7 +10,7 @@ class DataTypeTest extends TestCase public function testGetErrorCodes() { $result = DataType::getErrorCodes(); - self::assertInternalType('array', $result); + self::assertIsArray($result); self::assertGreaterThan(0, count($result)); self::assertArrayHasKey('#NULL!', $result); } diff --git a/tests/PhpSpreadsheetTests/Reader/OdsTest.php b/tests/PhpSpreadsheetTests/Reader/OdsTest.php index 59ae006b..bec85f7b 100644 --- a/tests/PhpSpreadsheetTests/Reader/OdsTest.php +++ b/tests/PhpSpreadsheetTests/Reader/OdsTest.php @@ -240,28 +240,28 @@ class OdsTest extends TestCase $properties = $spreadsheet->getProperties(); // Core Properties -// $this->assertSame('Mark Baker', $properties->getCreator()); - $this->assertSame('Property Test File', $properties->getTitle()); - $this->assertSame('Testing for Properties', $properties->getSubject()); - $this->assertSame('TEST ODS PHPSpreadsheet', $properties->getKeywords()); +// self::assertSame('Mark Baker', $properties->getCreator()); + self::assertSame('Property Test File', $properties->getTitle()); + self::assertSame('Testing for Properties', $properties->getSubject()); + self::assertSame('TEST ODS PHPSpreadsheet', $properties->getKeywords()); // Extended Properties -// $this->assertSame('PHPOffice', $properties->getCompany()); -// $this->assertSame('The Big Boss', $properties->getManager()); +// self::assertSame('PHPOffice', $properties->getCompany()); +// self::assertSame('The Big Boss', $properties->getManager()); // Custom Properties $customProperties = $properties->getCustomProperties(); - $this->assertInternalType('array', $customProperties); + self::assertIsArray($customProperties); $customProperties = array_flip($customProperties); - $this->assertArrayHasKey('TestDate', $customProperties); + self::assertArrayHasKey('TestDate', $customProperties); foreach ($customPropertySet as $propertyName => $testData) { - $this->assertTrue($properties->isCustomPropertySet($propertyName)); - $this->assertSame($testData['type'], $properties->getCustomPropertyType($propertyName)); + self::assertTrue($properties->isCustomPropertySet($propertyName)); + self::assertSame($testData['type'], $properties->getCustomPropertyType($propertyName)); if ($properties->getCustomPropertyType($propertyName) == Properties::PROPERTY_TYPE_DATE) { - $this->assertSame($testData['value'], date('Y-m-d', $properties->getCustomPropertyValue($propertyName))); + self::assertSame($testData['value'], date('Y-m-d', $properties->getCustomPropertyValue($propertyName))); } else { - $this->assertSame($testData['value'], $properties->getCustomPropertyValue($propertyName)); + self::assertSame($testData['value'], $properties->getCustomPropertyValue($propertyName)); } } } diff --git a/tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php b/tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php index c1d7fa38..0d9fc13f 100644 --- a/tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php +++ b/tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php @@ -82,7 +82,7 @@ class XmlScannerTest extends TestCase $scanner = $fileReader->getSecurityScanner(); // Must return an object... - $this->assertInternalType('object', $scanner); + self::assertIsObject($scanner); // ... of the correct type $this->assertInstanceOf(XmlScanner::class, $scanner); } diff --git a/tests/PhpSpreadsheetTests/Reader/XlsxTest.php b/tests/PhpSpreadsheetTests/Reader/XlsxTest.php index 5cf6f93f..1180aacc 100644 --- a/tests/PhpSpreadsheetTests/Reader/XlsxTest.php +++ b/tests/PhpSpreadsheetTests/Reader/XlsxTest.php @@ -40,7 +40,7 @@ class XlsxTest extends TestCase // Custom Properties $customProperties = $properties->getCustomProperties(); - $this->assertInternalType('array', $customProperties); + self::assertIsArray($customProperties); $customProperties = array_flip($customProperties); $this->assertArrayHasKey('Publisher', $customProperties); diff --git a/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php b/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php index 9ce636d8..855de2bc 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php @@ -127,7 +127,7 @@ class ColumnTest extends TestCase $this->testAutoFilterColumnObject->setAttributes($attributeSet); $result = $this->testAutoFilterColumnObject->getAttributes(); - self::assertInternalType('array', $result); + self::assertIsArray($result); self::assertCount(count($attributeSet), $result); } diff --git a/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php b/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php index 6766aac8..aa66eb8e 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php @@ -111,7 +111,7 @@ class AutoFilterTest extends TestCase { // There should be no columns yet defined $result = $this->testAutoFilterObject->getColumns(); - self::assertInternalType('array', $result); + self::assertIsArray($result); self::assertCount(0, $result); } @@ -151,7 +151,7 @@ class AutoFilterTest extends TestCase $result = $this->testAutoFilterObject->getColumns(); // Result should be an array of \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\AutoFilter\Column // objects for each column we set indexed by the column ID - self::assertInternalType('array', $result); + self::assertIsArray($result); self::assertCount(1, $result); self::assertArrayHasKey($expectedResult, $result); self::assertInstanceOf(Column::class, $result[$expectedResult]); @@ -178,7 +178,7 @@ class AutoFilterTest extends TestCase $result = $this->testAutoFilterObject->getColumns(); // Result should be an array of \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\AutoFilter\Column // objects for each column we set indexed by the column ID - self::assertInternalType('array', $result); + self::assertIsArray($result); self::assertCount(1, $result); self::assertArrayHasKey($expectedResult, $result); self::assertInstanceOf(Column::class, $result[$expectedResult]); @@ -211,7 +211,7 @@ class AutoFilterTest extends TestCase $result = $this->testAutoFilterObject->getColumns(); // Result should be an array of \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\AutoFilter\Column // objects for each column we set indexed by the column ID - self::assertInternalType('array', $result); + self::assertIsArray($result); self::assertCount(count($columnIndexes), $result); foreach ($columnIndexes as $columnIndex) { self::assertArrayHasKey($columnIndex, $result); @@ -288,7 +288,7 @@ class AutoFilterTest extends TestCase // Column array should be cleared $result = $this->testAutoFilterObject->getColumns(); - self::assertInternalType('array', $result); + self::assertIsArray($result); self::assertCount(0, $result); } @@ -318,7 +318,7 @@ class AutoFilterTest extends TestCase // Only columns that existed in the original range and that // still fall within the new range should be retained $result = $this->testAutoFilterObject->getColumns(); - self::assertInternalType('array', $result); + self::assertIsArray($result); self::assertCount(count($columnIndexes1), $result); }