View source
<?php
namespace Drupal\Tests\action\Unit\Plugin\migrate\source\d6;
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
class ActionTest extends MigrateSqlSourceTestCase {
const PLUGIN_CLASS = 'Drupal\\action\\Plugin\\migrate\\source\\d6\\Action';
protected $migrationConfiguration = array(
'id' => 'test',
'source' => array(
'plugin' => 'd6_action',
),
);
protected $expectedResults = array(
array(
'aid' => '1',
'type' => 'system',
'callback' => 'system_goto_action',
'parameters' => 'a:1:{s:3:"url";s:4:"node";}',
'description' => 'Redirect to node list page',
),
array(
'aid' => '2',
'type' => 'system',
'callback' => 'system_send_email_action',
'parameters' => 'a:3:{s:9:"recipient";s:7:"%author";s:7:"subject";s:4:"Test";s:7:"message";s:4:"Test',
'description' => 'Test notice email',
),
array(
'aid' => 'comment_publish_action',
'type' => 'comment',
'callback' => 'comment_publish_action',
'parameters' => null,
'description' => null,
),
array(
'aid' => 'node_publish_action',
'type' => 'comment',
'callback' => 'node_publish_action',
'parameters' => null,
'description' => null,
),
);
protected function setUp() {
$this->databaseContents['actions'] = $this->expectedResults;
parent::setUp();
}
}