Remove more spurious files that should not be in b15.

This commit is contained in:
Greg Anderson 2015-10-02 12:47:56 -07:00
parent 08dd73ad55
commit efbcb71ec3
84 changed files with 0 additions and 5289 deletions

View file

@ -1,50 +0,0 @@
<?php
/**
* @file
* Contains \Drupal\system\Plugin\migrate\source\d6\Menu.
*/
namespace Drupal\system\Plugin\migrate\source\d6;
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
/**
* Drupal 6 menu source from database.
*
* @MigrateSource(
* id = "d6_menu",
* source_provider = "menu"
* )
*/
class Menu extends DrupalSqlBase {
/**
* {@inheritdoc}
*/
public function query() {
$query = $this->select('menu_custom', 'm')
->fields('m', array('menu_name', 'title', 'description'));
return $query;
}
/**
* {@inheritdoc}
*/
public function fields() {
return array(
'menu_name' => $this->t('The menu name. Primary key.'),
'title' => $this->t('The human-readable name of the menu.'),
'description' => $this->t('A description of the menu'),
);
}
/**
* {@inheritdoc}
*/
public function getIds() {
$ids['menu_name']['type'] = 'string';
return $ids;
}
}

View file

@ -1,88 +0,0 @@
<?php
/**
* @file
* Contains \Drupal\system\Tests\PhpStorage\PhpStorageFactoryTest.
*/
namespace Drupal\system\Tests\PhpStorage;
use Drupal\Component\PhpStorage\MTimeProtectedFileStorage;
use Drupal\Core\PhpStorage\PhpStorageFactory;
use Drupal\Core\Site\Settings;
use Drupal\Core\StreamWrapper\PublicStream;
use Drupal\simpletest\KernelTestBase;
use Drupal\system\PhpStorage\MockPhpStorage;
/**
* Tests the PHP storage factory.
*
* @group PhpStorage
* @see \Drupal\Core\PhpStorage\PhpStorageFactory
*/
class PhpStorageFactoryTest extends KernelTestBase {
/**
* Tests the get() method with no settings.
*/
public function testGetNoSettings() {
$php = PhpStorageFactory::get('test');
// This should be the default class used.
$this->assertTrue($php instanceof MTimeProtectedFileStorage, 'An MTimeProtectedFileStorage instance was returned with no settings.');
}
/**
* Tests the get() method using the 'default' settings.
*/
public function testGetDefault() {
$this->setSettings();
$php = PhpStorageFactory::get('test');
$this->assertTrue($php instanceof MockPhpStorage, 'A FileReadOnlyStorage instance was returned with default settings.');
}
/**
* Tests the get() method with overridden settings.
*/
public function testGetOverride() {
$this->setSettings('test');
$php = PhpStorageFactory::get('test');
// The FileReadOnlyStorage should be used from settings.
$this->assertTrue($php instanceof MockPhpStorage, 'A MockPhpStorage instance was returned from overridden settings.');
// Test that the name is used for the bin when it is NULL.
$this->setSettings('test', array('bin' => NULL));
$php = PhpStorageFactory::get('test');
$this->assertTrue($php instanceof MockPhpStorage, 'An MockPhpStorage instance was returned from overridden settings.');
$this->assertIdentical('test', $php->getConfigurationValue('bin'), 'Name value was used for bin.');
// Test that a default directory is set if it's empty.
$this->setSettings('test', array('directory' => NULL));
$php = PhpStorageFactory::get('test');
$this->assertTrue($php instanceof MockPhpStorage, 'An MockPhpStorage instance was returned from overridden settings.');
$this->assertIdentical(\Drupal::root() . '/' . PublicStream::basePath() . '/php', $php->getConfigurationValue('directory'), 'Default file directory was used.');
// Test that a default storage class is set if it's empty.
$this->setSettings('test', array('class' => NULL));
$php = PhpStorageFactory::get('test');
$this->assertTrue($php instanceof MTimeProtectedFileStorage, 'An MTimeProtectedFileStorage instance was returned from overridden settings with no class.');
}
/**
* Sets the Settings() singleton.
*
* @param string $name
* The storage bin name to set.
* @param array $configuration
* An array of configuration to set. Will be merged with default values.
*/
protected function setSettings($name = 'default', array $configuration = array()) {
$settings['php_storage'][$name] = $configuration + array(
'class' => 'Drupal\system\PhpStorage\MockPhpStorage',
'directory' => 'tmp://',
'secret' => $this->randomString(),
'bin' => 'test',
);
new Settings($settings);
}
}

View file

@ -1,62 +0,0 @@
<?php
/**
* @file
* Contains \Drupal\Tests\system\Unit\Migrate\source\d6\MenuTest.
*/
namespace Drupal\Tests\system\Unit\Migrate\source\d6;
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
/**
* Tests D6 menu source plugin.
*
* @group system
*/
class MenuTest extends MigrateSqlSourceTestCase {
// The plugin system is not working during unit testing so the source plugin
// class needs to be manually specified.
const PLUGIN_CLASS = 'Drupal\system\Plugin\migrate\source\d6\Menu';
// The fake Migration configuration entity.
protected $migrationConfiguration = array(
// The ID of the entity, can be any string.
'id' => 'test',
// Leave it empty for now.
'idlist' => array(),
// This needs to be the identifier of the actual key: cid for comment, nid
// for node and so on.
'source' => array(
'plugin' => 'd6_menu',
),
);
// We need to set up the database contents; it's easier to do that below.
protected $expectedResults = array(
array(
'menu_name' => 'menu-name-1',
'title' => 'menu custom value 1',
'description' => 'menu custom description value 1',
),
array(
'menu_name' => 'menu-name-2',
'title' => 'menu custom value 2',
'description' => 'menu custom description value 2',
),
);
/**
* {@inheritdoc}
*/
protected function setUp() {
// This array stores the database.
foreach ($this->expectedResults as $k => $row) {
$this->databaseContents['menu_custom'][$k] = $row;
}
parent::setUp();
}
}