Skip to content

Commit e70d814

Browse files
committed
Tests added
1 parent 818d61f commit e70d814

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

includes/MslsLink.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public static function create( ?int $display ): MslsLink {
7575

7676
if ( has_filter( 'msls_link_create' ) ) {
7777
/**
78+
* @param MslsLink $obj
7879
* @param int $display
7980
*
8081
* @return MslsLink

phpstan.neon

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ parameters:
55
- MultisiteLanguageSwitcher.php
66
- includes
77
excludePaths:
8-
- tests
98
- vendor
10-
- includes/ContentImport
9+
- tests
1110
bootstrapFiles:
1211
- tests/phpstan/bootstrap.php
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace lloc\MslsTests\ContentImport\Importers;
4+
5+
use lloc\Msls\ContentImport\Importers\AttachmentsImporters;
6+
use lloc\MslsTests\MslsUnitTestCase;
7+
8+
class TestAttachmentsImporters extends MslsUnitTestCase {
9+
10+
11+
public function testDetails(): void {
12+
$obj = new AttachmentsImporters();
13+
14+
$expected = (object) array(
15+
'slug' => 'attachments',
16+
'name' => 'Image Attachments',
17+
'importers' => array(
18+
'linking' => (object) array(
19+
'name' => 'Linking',
20+
'description' => 'Links the media attachments from the source post to the destination post; media attachments are not duplicated.',
21+
'slug' => 'linking',
22+
),
23+
),
24+
'selected' => 'linking',
25+
);
26+
27+
$this->assertEquals( $expected, $obj->details() );
28+
}
29+
}

0 commit comments

Comments
 (0)