Unverified Commit fb6e22db authored by larowlan's avatar larowlan Committed by larowlan

Issue #3059747 by larowlan, Sam152: Fix HEAD

parent 4e9db5c0
......@@ -10,5 +10,8 @@
"issues": "http://drupal.org/project/issues/workbench_moderation",
"source": "http://cgit.drupalcode.org/workbench_moderation"
},
"require": { }
"require": { },
"require-dev": {
"drupal/publishing_dropbutton": "~1.0"
}
}
......@@ -4,7 +4,7 @@ namespace Drupal\Tests\workbench_moderation\Functional;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\simpletest\BrowserTestBase;
use Drupal\Tests\BrowserTestBase;
/**
* Tests the "Latest Revision" views filter.
......@@ -19,7 +19,16 @@ class LatestRevisionViewsFilterTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['workbench_moderation_test_views', 'workbench_moderation', 'node', 'views', 'options', 'user', 'system'];
public static $modules = [
'workbench_moderation_test_views',
'workbench_moderation',
'node',
'views',
'options',
'user',
'system',
'publishing_dropbutton',
];
/**
*
......@@ -106,7 +115,8 @@ class LatestRevisionViewsFilterTest extends BrowserTestBase {
$this->assertFalse($page->hasContent('Node 2 - Rev 1'));
$this->assertFalse($page->hasContent('Node 3 - Rev 1'));
$this->assertFalse($page->hasContent('Node 3 - Rev 2'));
$this->assertFalse($page->hasContent('Node 0 - Rev 1'));
// This will be there from the left-join.
$this->assertTrue($page->hasContent('Node 0 - Rev 1'));
}
/**
......
<?php
namespace Drupal\workbench_moderation\Tests;
namespace Drupal\Tests\workbench_moderation\Functional;
/**
* Tests the moderation form, specifically on nodes.
......@@ -31,7 +31,7 @@ class ModerationFormTest extends ModerationStateTestBase {
* the default revision is not a published moderation state.
*
* @see \Drupal\workbench_moderation\EntityOperations
* @see \Drupal\workbench_moderation\Tests\ModerationStateBlockTest::testCustomBlockModeration
* @see \Drupal\Tests\workbench_moderation\Functional\ModerationStateBlockTest::testCustomBlockModeration
*/
public function testModerationForm() {
// Create new moderated content in draft.
......
<?php
namespace Drupal\workbench_moderation\Tests;
namespace Drupal\Tests\workbench_moderation\Functional;
/**
* Test workbench_moderation functionality with localization and translation.
......
<?php
namespace Drupal\workbench_moderation\Tests;
namespace Drupal\Tests\workbench_moderation\Functional;
use Drupal\block_content\Entity\BlockContent;
use Drupal\block_content\Entity\BlockContentType;
......@@ -46,7 +46,7 @@ class ModerationStateBlockTest extends ModerationStateTestBase {
* The test below is intended, in part, to make this behavior clear.
*
* @see \Drupal\workbench_moderation\EntityOperations::entityPresave
* @see \Drupal\workbench_moderation\Tests\ModerationFormTest::testModerationForm
* @see \Drupal\Tests\workbench_moderation\Functional\ModerationFormTest::testModerationForm
*/
public function testCustomBlockModeration() {
$this->drupalLogin($this->rootUser);
......
<?php
namespace Drupal\workbench_moderation\Tests;
namespace Drupal\Tests\workbench_moderation\Functional;
use Drupal\Core\Url;
use Drupal\node\Entity\Node;
......@@ -124,7 +124,7 @@ class ModerationStateNodeTest extends ModerationStateTestBase {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/content');
$element = $this->cssSelect('nav.pager li.is-active a');
$url = (string) $element[0]['href'];
$url = $element[0]->getAttribute('href');
$query = [];
parse_str(parse_url($url, PHP_URL_QUERY), $query);
$this->assertEqual(0, $query['page']);
......
<?php
namespace Drupal\workbench_moderation\Tests;
use Drupal\Core\Session\AccountInterface;
use Drupal\user\Entity\Role;
namespace Drupal\Tests\workbench_moderation\Functional;
/**
* Tests moderation state node type integration.
......
<?php
namespace Drupal\workbench_moderation\Tests;
namespace Drupal\Tests\workbench_moderation\Functional;
/**
* Tests moderation state config entity.
......
<?php
namespace Drupal\workbench_moderation\Tests;
namespace Drupal\Tests\workbench_moderation\Functional;
use Drupal\Core\Session\AccountInterface;
use Drupal\simpletest\WebTestBase;
use Drupal\FunctionalTests\AssertLegacyTrait;
use Drupal\Tests\BrowserTestBase;
use Drupal\user\Entity\Role;
use Drupal\workbench_moderation\Entity\ModerationState;
/**
* Defines a base class for moderation state tests.
*/
abstract class ModerationStateTestBase extends WebTestBase {
abstract class ModerationStateTestBase extends BrowserTestBase {
use AssertLegacyTrait;
/**
* Profile to use.
......@@ -53,6 +56,7 @@ abstract class ModerationStateTestBase extends WebTestBase {
'workbench_moderation',
'block',
'block_content',
'publishing_dropbutton',
'node',
'views',
'options',
......
<?php
namespace Drupal\workbench_moderation\Tests;
namespace Drupal\Tests\workbench_moderation\Functional;
/**
* Tests moderation state transition config entity.
......
<?php
namespace Drupal\workbench_moderation\Tests;
namespace Drupal\Tests\workbench_moderation\Functional;
use Drupal\node\NodeInterface;
......
......@@ -6,6 +6,7 @@ use Drupal\entity_test\Entity\EntityTest;
use Drupal\KernelTests\KernelTestBase;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\user\Traits\UserCreationTrait;
/**
* @coversDefaultClass \Drupal\workbench_moderation\ParamConverter\EntityRevisionConverter
......@@ -13,6 +14,7 @@ use Drupal\node\Entity\NodeType;
*/
class EntityRevisionConverterTest extends KernelTestBase {
use UserCreationTrait;
public static $modules = ['user', 'entity_test', 'system', 'workbench_moderation', 'node'];
/**
......@@ -24,8 +26,8 @@ class EntityRevisionConverterTest extends KernelTestBase {
$this->installEntitySchema('entity_test');
$this->installEntitySchema('node');
$this->installEntitySchema('user');
$this->setUpCurrentUser();
$this->installSchema('system', 'router');
$this->installSchema('system', 'sequences');
$this->installSchema('node', 'node_access');
\Drupal::service('router.builder')->rebuild();
}
......
......@@ -96,8 +96,6 @@ class EntityStateChangeValidationTest extends KernelTestBase {
/**
* Verifies that content without prior moderation information can be moderated.
*
* @legacy
*/
public function testContent() {
$this->setCurrentUser($this->adminUser);
......@@ -137,8 +135,6 @@ class EntityStateChangeValidationTest extends KernelTestBase {
/**
* Verifies that content without prior moderation information can be translated.
*
* @legacy
*/
public function testMultilingualContent() {
// Enable French
......
......@@ -68,11 +68,11 @@ class ViewsDataTest extends ViewsKernelTestBase {
'nid' => $node->id(),
'revision_id' => $revision->getRevisionId(),
'title' => $revision->label(),
'moderation_state_revision' => 'published',
'moderation_state_revision' => 'draft',
'moderation_state' => 'published',
],
];
$this->assertIdenticalResultset($view, $expected_result, ['nid' => 'nid', 'workbench_revision_tracker_revision_id' => 'revision_id', 'moderation_state_revision' => 'moderation_state_revision', 'moderation_state' => 'moderation_state']);
$this->assertIdenticalResultset($view, $expected_result, ['title' => 'title', 'nid' => 'nid', 'workbench_revision_tracker_revision_id' => 'revision_id', 'moderation_state_revision' => 'moderation_state_revision', 'moderation_state' => 'moderation_state']);
}
}
......@@ -9,6 +9,7 @@ use Drupal\Core\Access\AccessResultForbidden;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Routing\RouteMatch;
use Drupal\node\Entity\Node;
use Drupal\Tests\UnitTestCase;
use Drupal\workbench_moderation\Access\LatestRevisionCheck;
use Drupal\workbench_moderation\ModerationInformation;
use Drupal\workbench_moderation\ModerationInformationInterface;
......@@ -18,7 +19,7 @@ use Symfony\Component\Routing\Route;
* @coversDefaultClass \Drupal\workbench_moderation\Access\LatestRevisionCheck
* @group workbench_moderation
*/
class LatestRevisionCheckTest extends \PHPUnit_Framework_TestCase {
class LatestRevisionCheckTest extends UnitTestCase {
/**
* Test the access check of the LatestRevisionCheck service.
......
......@@ -10,13 +10,14 @@ use Drupal\Core\Entity\EntityFormInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Tests\UnitTestCase;
use Drupal\workbench_moderation\ModerationInformation;
/**
* @coversDefaultClass \Drupal\workbench_moderation\ModerationInformation
* @group workbench_moderation
*/
class ModerationInformationTest extends \PHPUnit_Framework_TestCase {
class ModerationInformationTest extends UnitTestCase {
/**
* Builds a mock user.
......
......@@ -6,6 +6,7 @@ use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Session\AccountInterface;
use Drupal\Tests\UnitTestCase;
use Drupal\workbench_moderation\ModerationStateInterface;
use Drupal\workbench_moderation\ModerationStateTransitionInterface;
use Drupal\workbench_moderation\StateTransitionValidation;
......@@ -15,7 +16,7 @@ use Prophecy\Argument;
* @coversDefaultClass \Drupal\workbench_moderation\StateTransitionValidation
* @group workbench_moderation
*/
class StateTransitionValidationTest extends \PHPUnit_Framework_TestCase {
class StateTransitionValidationTest extends UnitTestCase {
/**
* Builds a mock storage object for Transitions.
......
......@@ -2,6 +2,7 @@
namespace Drupal\Tests\workbench_moderation\Unit;
use Drupal\Tests\UnitTestCase;
use Drupal\workbench_moderation\WorkbenchPreprocess;
use Drupal\Core\Routing\CurrentRouteMatch;
use Drupal\node\Entity\Node;
......@@ -13,7 +14,7 @@ use Drupal\node\Entity\Node;
* @coversDefaultClass \Drupal\workbench_moderation\WorkbenchPreprocess
* @group workbench_moderation
*/
class WorkbenchPreprocessTest extends \PHPUnit_Framework_TestCase {
class WorkbenchPreprocessTest extends UnitTestCase {
/**
* @covers ::isLatestVersionPage
......
......@@ -5,5 +5,7 @@ core: 8.x
package: Other
configure: workbench_moderation.overview
dependencies:
- views
- options
- drupal:views
- drupal:options
test_dependencies:
- publishing_dropbutton:publishing_dropbutton
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment