feat: wire file transport services
This commit is contained in:
@@ -3,8 +3,10 @@
|
||||
namespace WPContentSync\Tests\Unit;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use WPContentSync\Admin\FileImportController;
|
||||
use WPContentSync\Container;
|
||||
use WPContentSync\Plugin;
|
||||
use WPContentSync\Transport\FileTransportInterface;
|
||||
use WPContentSync\Url\MetadataUrlTransformer;
|
||||
use WPContentSync\Url\UrlTransformer;
|
||||
|
||||
@@ -21,6 +23,19 @@ class PluginTest extends TestCase {
|
||||
self::assertSame( $metadata_transformer, $container->get( MetadataUrlTransformer::class ) );
|
||||
}
|
||||
|
||||
public function test_it_registers_file_transport_services(): void {
|
||||
$container = $this->getPluginContainer( Plugin::create() );
|
||||
|
||||
self::assertInstanceOf(
|
||||
FileTransportInterface::class,
|
||||
$container->get( FileTransportInterface::class )
|
||||
);
|
||||
self::assertInstanceOf(
|
||||
FileImportController::class,
|
||||
$container->get( FileImportController::class )
|
||||
);
|
||||
}
|
||||
|
||||
private function getPluginContainer( Plugin $plugin ): Container {
|
||||
$reflection = new \ReflectionClass( $plugin );
|
||||
$property = $reflection->getProperty( 'container' );
|
||||
|
||||
Reference in New Issue
Block a user