You are here

UserPictureInstanceTest.php in Zircon Profile 8.0

File

core/modules/user/tests/src/Unit/Migrate/UserPictureInstanceTest.php
View source
<?php

/**
 * @file
 * Contains \Drupal\Tests\user\Unit\Migrate\UserPictureInstanceTest.
 */
namespace Drupal\Tests\user\Unit\Migrate;

use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
use Drupal\user\Plugin\migrate\source\UserPictureInstance;

/**
 * Tests user_picture_instance source plugin.
 *
 * @group user
 */
class UserPictureInstanceTest extends MigrateSqlSourceTestCase {
  const PLUGIN_CLASS = UserPictureInstance::class;
  protected $migrationConfiguration = [
    'id' => 'test',
    'source' => [
      'plugin' => 'user_picture_instance',
    ],
  ];
  protected $expectedResults = array(
    array(
      'id' => '',
      'file_directory' => 'pictures',
      'max_filesize' => '128KB',
      'max_resolution' => '128x128',
    ),
  );

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    $this->databaseContents['variable'] = array(
      array(
        'name' => 'file_directory',
        'value' => serialize(NULL),
      ),
      array(
        'name' => 'user_picture_file_size',
        'value' => serialize(128),
      ),
      array(
        'name' => 'user_picture_dimensions',
        'value' => serialize('128x128'),
      ),
    );
    parent::setUp();
  }

}

Classes

Namesort descending Description
UserPictureInstanceTest Tests user_picture_instance source plugin.