Skip to content

Commit afc7572

Browse files
authored
Merge pull request #367 from lloc/version-2-9-2
Upgrade of PHPUnit to version 10
2 parents 77a2687 + 79e0379 commit afc7572

10 files changed

+16
-16
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"ext-json": "*"
1111
},
1212
"require-dev": {
13-
"phpunit/phpunit": "^9.6",
13+
"phpunit/phpunit": "^10",
1414
"brain/monkey": "^2.6",
1515
"phpstan/phpstan": "^1.11",
1616
"szepeviktor/phpstan-wordpress": "^1.3",

phpunit.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
<?xml version="1.0"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="true" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage>
4-
<include>
5-
<directory suffix=".php">./includes/</directory>
6-
</include>
7-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="true" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache">
83
<php>
94
<const name="MSLS_PLUGIN_PATH" value="multisite-language-switcher/MultisiteLanguageSwitcher.php"/>
105
<const name="MSLS_PLUGIN__FILE__" value="/var/www/html/wp-content/plugins/multisite-language-switcher/MultisiteLanguageSwitcher.php"/>
@@ -13,4 +8,9 @@
138
<testsuite name="Internal tests">
149
<directory prefix="Test" suffix=".php">./tests/phpunit</directory>
1510
</testsuite>
11+
<source>
12+
<include>
13+
<directory suffix=".php">./includes/</directory>
14+
</include>
15+
</source>
1616
</phpunit>

tests/phpunit/ContentImport/TestAttachmentPathFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function setUp(): void {
1414
$this->test = new AttachmentPathFinder();
1515
}
1616

17-
public function dataprovider_filter_srcset() {
17+
public static function dataprovider_filter_srcset(): array {
1818
$image_src = 'http://example.com/image.jpg';
1919
$msls_imported = array(
2020
'blog' => 1,

tests/phpunit/ContentImport/TestImportCoordinates.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function setUp(): void {
2323
$this->test->dest_lang = 'it_IT';
2424
}
2525

26-
public function provider_validate(): array {
26+
public static function provider_validate(): array {
2727
$post = \Mockery::mock( \WP_Post::class );
2828
return array(
2929
array( null, null, null, null, null, false ),

tests/phpunit/ContentImport/TestImportLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function setUp(): void {
1616
$this->test = new ImportLogger( $coordinates );
1717
}
1818

19-
public function provider_get_data(): array {
19+
public static function provider_get_data(): array {
2020
return array(
2121
array( 'info' ),
2222
array( 'error' ),

tests/phpunit/TestMslsAdminIcon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function test_set_icon_type(): void {
177177
$this->assertInstanceOf( MslsAdminIcon::class, $obj->set_icon_type( 'flag' ) );
178178
}
179179

180-
public function icon_type_provider(): array {
180+
public static function icon_type_provider(): array {
181181
return array(
182182
array( 'flag', 'de_DE', '<span class="flag-icon flag-icon-de">de_DE</span>' ),
183183
array( 'label', 'it_IT', '<span class="language-badge it_IT"><span>it</span><span>IT</span></span>' ),

tests/phpunit/TestMslsBlog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function test_get_title(): void {
9999
*
100100
* @return array[]
101101
*/
102-
public function compareProvider() {
102+
public static function compareProvider(): array {
103103
return array(
104104
array( 0, 0, 0 ),
105105
array( 0, 1, - 1 ),

tests/phpunit/TestMslsContentFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
class TestMslsContentFilter extends MslsUnitTestCase {
1515

16-
protected function provide_content_filter_data(): array {
16+
public static function provide_content_filter_data(): array {
1717
return array(
1818
array( 'Test', 'Test', true, false, false ),
1919
array( 'Test', 'Test', false, false, false ),

tests/phpunit/TestMslsMetaBox.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function test_render_options() {
9494
$this->assertEquals( '<option value="42" selected="selected">A random title</option>', $this->test->render_options( 'post', 42 ) );
9595
}
9696

97-
public function add_data_provider() {
97+
public static function add_data_provider(): array {
9898
return array(
9999
array( array( 'post', 'page' ), 8, 8, true, true ),
100100
array( array( 'book' ), 3, 6, false, false ),
@@ -169,7 +169,7 @@ public function test_render_select_hierarchical() {
169169
$this->test->render_select();
170170
}
171171

172-
protected function render_input_provider() {
172+
public static function render_input_provider(): array {
173173
return array(
174174
array( array( 'de_DE' => 42 ), 1, 0, 0, 1, '<ul><li class=""><label for="msls_title_ msls-icon-wrapper flag"><a title="Edit the translation in the de_DE-blog" href="edit-post-link"><span class="flag-icon flag-icon-de">de_DE</span></a>&nbsp;</label><input type="hidden" id="msls_id_" name="msls_input_de_DE" value="42"/><input class="msls_title" id="msls_title_" name="msls_title_" type="text" value="Test"/></li></ul><input type="hidden" name="msls_post_type" id="msls_post_type" value="page"/><input type="hidden" name="msls_action" id="msls_action" value="suggest_posts"/>' ),
175175
array( array( 'en_US' => 17 ), 0, 1, 1, 0, '<ul><li class=""><label for="msls_title_ msls-icon-wrapper flag"><a title="Create a new translation in the de_DE-blog" href="admin-url-empty"><span class="flag-icon flag-icon-de">de_DE</span></a>&nbsp;</label><input type="hidden" id="msls_id_" name="msls_input_de_DE" value=""/><input class="msls_title" id="msls_title_" name="msls_title_" type="text" value=""/></li></ul><input type="hidden" name="msls_post_type" id="msls_post_type" value="page"/><input type="hidden" name="msls_action" id="msls_action" value="suggest_posts"/>' ),

tests/phpunit/TestMslsOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function test_get_icon_type_admin_display(): void {
163163
$this->assertEquals( MslsAdminIcon::TYPE_LABEL, $obj->get_icon_type() );
164164
}
165165

166-
public function provide_data_for_slug_check(): array {
166+
public static function provide_data_for_slug_check(): array {
167167
return array(
168168
array( '', '', false, false, false, '', false ), // first return
169169
array( null, '', false, false, false, '', false ), // first return

0 commit comments

Comments
 (0)