Skip to content

Commit bd2fadf

Browse files
committed
Tests cleaned up
1 parent ffea2b4 commit bd2fadf

File tree

68 files changed

+555
-460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+555
-460
lines changed

includes/MslsBlock.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
class MslsBlock {
66

7-
87
protected MslsOptions $options;
98

109
public function __construct( MslsOptions $options ) {

tests/phpunit/Component/Icon/TestIconPng.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use lloc\Msls\Component\Icon\IconPng;
77
use lloc\MslsTests\MslsUnitTestCase;
88

9-
class TestIconPng extends MslsUnitTestCase {
9+
final class TestIconPng extends MslsUnitTestCase {
1010

1111
public function test_get(): void {
1212
Functions\when( 'plugin_dir_path' )->justReturn( dirname( __DIR__, 4 ) . '/' );

tests/phpunit/Component/Icon/TestIconSvg.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use lloc\Msls\Component\Icon\IconSvg;
77
use lloc\MslsTests\MslsUnitTestCase;
88

9-
class TestIconSvg extends MslsUnitTestCase {
9+
final class TestIconSvg extends MslsUnitTestCase {
1010

1111
public function test_get(): void {
1212
Functions\when( 'plugin_dir_path' )->justReturn( dirname( __DIR__, 4 ) . '/' );

tests/phpunit/ContentImport/Importers/Attachments/TestLinking.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use lloc\Msls\ContentImport\Importers\Attachments\Linking;
88
use lloc\MslsTests\MslsUnitTestCase;
99

10-
class TestLinking extends MslsUnitTestCase {
10+
final class TestLinking extends MslsUnitTestCase {
1111

1212
public function testImport(): void {
1313
$coordinates = \Mockery::mock( ImportCoordinates::class );

tests/phpunit/ContentImport/Importers/PostFields/TestDuplicating.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use lloc\Msls\ContentImport\Importers\PostFields\Duplicating;
88
use lloc\MslsTests\MslsUnitTestCase;
99

10-
class TestDuplicating extends MslsUnitTestCase {
10+
final class TestDuplicating extends MslsUnitTestCase {
1111

1212
public function testImport(): void {
1313
Functions\expect( 'wp_insert_post' )->once();

tests/phpunit/ContentImport/Importers/PostMeta/TestDuplicating.php

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

1010
use function Brain\Monkey\Functions;
1111

12-
class TestDuplicating extends MslsUnitTestCase {
12+
final class TestDuplicating extends MslsUnitTestCase {
1313

1414
public function testImport(): void {
1515
Functions\expect( 'switch_to_blog' )->twice();

tests/phpunit/ContentImport/Importers/TestAttachmentsImporters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use lloc\Msls\ContentImport\Importers\AttachmentsImporters;
66
use lloc\MslsTests\MslsUnitTestCase;
77

8-
class TestAttachmentsImporters extends MslsUnitTestCase {
8+
final class TestAttachmentsImporters extends MslsUnitTestCase {
99

1010

1111
public function testDetails(): void {

tests/phpunit/ContentImport/Importers/TestBaseImporter.php

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,44 @@
88
use lloc\Msls\ContentImport\Relations;
99
use lloc\MslsTests\MslsUnitTestCase;
1010

11-
class TestBaseImporter extends MslsUnitTestCase {
12-
13-
public function setUp(): void {
14-
parent::setUp();
11+
final class TestBaseImporter extends MslsUnitTestCase {
1512

13+
private function BaseImporterFactory(): BaseImporter {
1614
$import_coordinates = \Mockery::mock( ImportCoordinates::class );
17-
$this->test = new BaseImporter( $import_coordinates );
15+
16+
return new BaseImporter( $import_coordinates );
1817
}
1918

2019
public function testImport(): void {
21-
$this->assertEquals( array(), $this->test->import( array() ) );
20+
$test = $this->BaseImporterFactory();
21+
22+
$this->assertEquals( array(), $test->import( array() ) );
2223
}
2324

2425
public function testSetImportCoordinates(): void {
2526
$import_coordinates = \Mockery::mock( ImportCoordinates::class );
2627

2728
$this->expectNotToPerformAssertions();
28-
$this->test->set_import_coordinates( $import_coordinates );
29+
30+
$test = $this->BaseImporterFactory();
31+
32+
$test->set_import_coordinates( $import_coordinates );
2933
}
3034

3135
public function testGetLogger(): void {
32-
$this->assertInstanceOf( ImportLogger::class, $this->test->get_logger() );
36+
$test = $this->BaseImporterFactory();
37+
38+
$this->assertInstanceOf( ImportLogger::class, $test->get_logger() );
3339
}
3440
public function testGetRelations(): void {
35-
$this->assertInstanceOf( Relations::class, $this->test->get_relations() );
41+
$test = $this->BaseImporterFactory();
42+
43+
$this->assertInstanceOf( Relations::class, $test->get_relations() );
3644
}
3745

3846
public function testInfo(): void {
39-
$this->assertInstanceOf( \stdClass::class, $this->test->info() );
47+
$test = $this->BaseImporterFactory();
48+
49+
$this->assertInstanceOf( \stdClass::class, $test->info() );
4050
}
4151
}

tests/phpunit/ContentImport/Importers/TestImportersBaseFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use lloc\MslsTests\MslsUnitTestCase;
88
use Mockery\Mock;
99

10-
class TestImportersBaseFactory extends MslsUnitTestCase {
10+
final class TestImportersBaseFactory extends MslsUnitTestCase {
1111

1212
public function testMake(): void {
1313
$coordinates = \Mockery::mock( ImportCoordinates::class );

tests/phpunit/ContentImport/Importers/TestMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use lloc\Msls\ContentImport\Importers\Map;
77
use lloc\MslsTests\MslsUnitTestCase;
88

9-
class TestMap extends MslsUnitTestCase {
9+
final class TestMap extends MslsUnitTestCase {
1010

1111
public function testMake(): void {
1212
$coordinates = \Mockery::mock( ImportCoordinates::class );

0 commit comments

Comments
 (0)