MDL-81521 core: Update all possibly data providers to be static
Note: Some data providers could not be automatically be converted to being static. These will be handled in a separate issue.
This commit is contained in:
@@ -80,7 +80,7 @@ class phpunit_dataset_test extends advanced_testcase {
|
||||
/**
|
||||
* test_from_file() data provider.
|
||||
*/
|
||||
public function from_file_provider() {
|
||||
public static function from_file_provider(): array {
|
||||
// Create an unreadable file with vfsStream.
|
||||
$vfsfile = vfsStream::newFile('unreadable', 0222);
|
||||
vfsStream::setup('root')->addChild($vfsfile);
|
||||
@@ -177,7 +177,7 @@ class phpunit_dataset_test extends advanced_testcase {
|
||||
/**
|
||||
* test_from_string() data provider.
|
||||
*/
|
||||
public function from_string_provider() {
|
||||
public static function from_string_provider(): array {
|
||||
|
||||
return [
|
||||
'wrong type' => [
|
||||
@@ -267,7 +267,7 @@ class phpunit_dataset_test extends advanced_testcase {
|
||||
/**
|
||||
* test_from_array() data provider.
|
||||
*/
|
||||
public function from_array_provider() {
|
||||
public static function from_array_provider(): array {
|
||||
return [
|
||||
'repeated array table many structures' => [
|
||||
'structure' => [
|
||||
@@ -413,7 +413,7 @@ class phpunit_dataset_test extends advanced_testcase {
|
||||
/**
|
||||
* test_load_csv() data provider.
|
||||
*/
|
||||
public function load_csv_provider() {
|
||||
public static function load_csv_provider(): array {
|
||||
|
||||
return [
|
||||
'repeated csv table many files' => [
|
||||
@@ -501,7 +501,7 @@ class phpunit_dataset_test extends advanced_testcase {
|
||||
/**
|
||||
* test_load_xml() data provider.
|
||||
*/
|
||||
public function load_xml_provider() {
|
||||
public static function load_xml_provider(): array {
|
||||
|
||||
return [
|
||||
'repeated xml table multiple files' => [
|
||||
@@ -669,7 +669,7 @@ class phpunit_dataset_test extends advanced_testcase {
|
||||
/**
|
||||
* test_to_database() data provider.
|
||||
*/
|
||||
public function to_database_provider() {
|
||||
public static function to_database_provider(): array {
|
||||
|
||||
return [
|
||||
'wrong table requested' => [
|
||||
@@ -824,7 +824,7 @@ class phpunit_dataset_test extends advanced_testcase {
|
||||
/**
|
||||
* test_get_rows() data provider.
|
||||
*/
|
||||
public function get_rows_provider() {
|
||||
public static function get_rows_provider(): array {
|
||||
|
||||
return [
|
||||
'wrong table requested' => [
|
||||
|
||||
Reference in New Issue
Block a user