Skip to content

Commit

Permalink
Tests added
Browse files Browse the repository at this point in the history
  • Loading branch information
lloc committed Sep 3, 2024
1 parent 818d61f commit e70d814
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions includes/MslsLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public static function create( ?int $display ): MslsLink {

if ( has_filter( 'msls_link_create' ) ) {
/**
* @param MslsLink $obj
* @param int $display
*
* @return MslsLink
Expand Down
3 changes: 1 addition & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ parameters:
- MultisiteLanguageSwitcher.php
- includes
excludePaths:
- tests
- vendor
- includes/ContentImport
- tests
bootstrapFiles:
- tests/phpstan/bootstrap.php
29 changes: 29 additions & 0 deletions tests/phpunit/ContentImport/Importers/TestAttachmentsImporters.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace lloc\MslsTests\ContentImport\Importers;

use lloc\Msls\ContentImport\Importers\AttachmentsImporters;
use lloc\MslsTests\MslsUnitTestCase;

class TestAttachmentsImporters extends MslsUnitTestCase {


public function testDetails(): void {
$obj = new AttachmentsImporters();

$expected = (object) array(
'slug' => 'attachments',
'name' => 'Image Attachments',
'importers' => array(
'linking' => (object) array(
'name' => 'Linking',
'description' => 'Links the media attachments from the source post to the destination post; media attachments are not duplicated.',
'slug' => 'linking',
),
),
'selected' => 'linking',
);

$this->assertEquals( $expected, $obj->details() );
}
}

0 comments on commit e70d814

Please sign in to comment.