'name'], ['name' => 'otherName'], ['secondName' => 'something']]; $object = new TikiImporterGranSon(); $this->assertEquals($expectedResult, $object->getOptions()); $expectedResult = [['name' => 'someName', 'property1' => 'someProperty'], ['name' => 'differentName', 'property' => 'anotherProperty']]; $object = new TikiImporterFirstChild(); $this->assertEquals($expectedResult, $object->getOptions()); } public function testChangePhpSettings(): void { TikiImporter::changePhpSettings(); $this->assertEquals(E_ALL & ~E_DEPRECATED, ini_get('error_reporting'), 'Should change the value of the error reporting'); $this->assertEquals('on', ini_get('display_errors'), 'Should change the value of display_errors'); $this->assertEquals(0, ini_get('max_execution_time'), 'Should change the value of max_execution_time'); } public function testDisplayPhpUploadError(): void { $this->assertNull(TikiImporter::displayPhpUploadError(-1), 'Should return null if invalid code passed as param'); $this->assertEquals('No file was uploaded.', TikiImporter::displayPhpUploadError(4)); } } // dummy classes to test the TikiImporter::getOptions() class TikiImporterFirstChild extends TikiImporter { public static function importOptions(): array { return [ ['name' => 'someName', 'property1' => 'someProperty'], ['name' => 'differentName', 'property' => 'anotherProperty'] ]; } } class TikiImporterSecondChild extends TikiImporter { public static function importOptions(): array { return [ ['name' => 'otherName'], ['secondName' => 'something'] ]; } } class TikiImporterGranSon extends TikiImporterSecondChild { public static function importOptions(): array { return [ ['name' => 'name'] ]; } }