Skip to content
Snippets Groups Projects
Commit b6fd2c78 authored by Michael Lee's avatar Michael Lee
Browse files

Merge branch 'video_embed_field' into lee5151

parents 1e8ba1e5 da223c6c
No related branches found
No related tags found
No related merge requests found
Showing
with 43 additions and 32 deletions
......@@ -17,7 +17,7 @@ class AutoplayPermissionTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
public static $modules = [
protected static $modules = [
'video_embed_field',
'node',
];
......
......@@ -22,7 +22,7 @@ class FieldConfigurationTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
protected static $modules = [
'field_ui',
'node',
'video_embed_field',
......
......@@ -23,7 +23,7 @@ class FormatterConfigurationTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
protected static $modules = [
'video_embed_field',
'node',
'field_ui',
......@@ -40,7 +40,7 @@ class FormatterConfigurationTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->drupalLogin($this->createAdminUser());
$this->setupEntityDisplays();
......
......@@ -21,7 +21,7 @@ class InstallationTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->drupalLogin($this->createAdminUser());
}
......@@ -58,11 +58,13 @@ protected function assertInstallationStatus($installed) {
* Uninstall the module using the UI.
*/
protected function uninstallModules() {
$this->drupalPostForm('admin/modules/uninstall', [
$this->drupalGet('admin/modules/uninstall');
$this->submitForm([
'uninstall[video_embed_wysiwyg]' => TRUE,
], 'Uninstall');
$this->getSession()->getPage()->pressButton('Uninstall');
$this->drupalPostForm('admin/modules/uninstall', [
$this->drupalGet('admin/modules/uninstall');
$this->submitForm([
'uninstall[video_embed_field]' => TRUE,
], 'Uninstall');
$this->getSession()->getPage()->pressButton('Uninstall');
......@@ -72,7 +74,8 @@ protected function uninstallModules() {
* Install the modules using the UI.
*/
protected function installModules() {
$this->drupalPostForm('admin/modules', [
$this->drupalGet('admin/modules');
$this->submitForm([
'modules[video_embed_field][enable]' => TRUE,
'modules[video_embed_wysiwyg][enable]' => TRUE,
], 'Install');
......
......@@ -23,7 +23,7 @@ class WidgetTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
protected static $modules = [
'field_ui',
'node',
'video_embed_field',
......
......@@ -22,7 +22,7 @@ class ColorboxFormatterTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
protected static $modules = [
'node',
'colorbox',
'video_embed_field',
......@@ -38,7 +38,7 @@ class ColorboxFormatterTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->setupEntityDisplays();
}
......
......@@ -22,7 +22,7 @@ class LazyLoadFormatterTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
protected static $modules = [
'node',
'video_embed_field',
'video_embed_field_mock_provider',
......@@ -31,7 +31,7 @@ class LazyLoadFormatterTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->setupEntityDisplays();
}
......
......@@ -25,7 +25,7 @@ class ConstraintTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->installEntitySchema('user');
......
......@@ -21,7 +21,7 @@ class Drupal6EmfieldMigrationTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
protected static $modules = [
'video_embed_field',
];
......
......@@ -21,7 +21,7 @@ class Drupal7MigrationTest extends MigrateDrupal7TestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
protected static $modules = [
'video_embed_field',
'comment',
'datetime',
......@@ -44,7 +44,7 @@ protected function getFixtureFilePath() {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->installEntitySchema('node');
......
......@@ -21,7 +21,10 @@ trait EntityLoadTrait {
protected function loadEntityByLabel($label, $entity_type = 'node') {
$type_manager = \Drupal::entityTypeManager();
$label_key = $type_manager->getDefinition($entity_type)->getKey('label');
$entities = \Drupal::entityQuery($entity_type)->condition($label_key, $label, '=')->execute();
$entities = \Drupal::entityQuery($entity_type)
->accessCheck(TRUE)
->condition($label_key, $label, '=')
->execute();
return $type_manager->getStorage($entity_type)->load(array_shift($entities));
}
......
......@@ -35,7 +35,7 @@ class FormatterDependenciesTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->style = ImageStyle::create(['name' => 'style_foo', 'label' => $this->randomString()]);
......
......@@ -2,6 +2,7 @@
namespace Drupal\Tests\video_embed_field\Kernel;
use Drupal\colorbox\ColorboxAttachment;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\Core\File\FileSystemInterface;
use Drupal\field\Entity\FieldConfig;
......@@ -32,7 +33,7 @@ abstract class KernelTestBase extends CoreKernelTestBase {
*
* @var array
*/
public static $modules = [
protected static $modules = [
'colorbox',
'user',
'system',
......@@ -47,7 +48,7 @@ abstract class KernelTestBase extends CoreKernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->installEntitySchema($this->entityTypeId);
......@@ -75,7 +76,7 @@ protected function setUp() {
$this->container->set('http_client', new MockHttpClient());
// Shim in a service required from the colorbox module.
$colorbox_mock = $this->getMockBuilder('ColorboxAttachment')->setMethods(['attach'])->getMock();
$colorbox_mock = $this->createMock(ColorboxAttachment::class);
$this->container->set('colorbox.attachment', $colorbox_mock);
}
......
......@@ -3,7 +3,9 @@
namespace Drupal\Tests\video_embed_field\Kernel;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* An exceptional HTTP client mock.
......@@ -18,35 +20,35 @@ class MockHttpClient implements ClientInterface {
/**
* {@inheritdoc}
*/
public function send(RequestInterface $request, array $options = []) {
public function send(RequestInterface $request, array $options = []): ResponseInterface {
throw new \Exception(static::EXCEPTION_MESSAGE);
}
/**
* {@inheritdoc}
*/
public function sendAsync(RequestInterface $request, array $options = []) {
public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface {
throw new \Exception(static::EXCEPTION_MESSAGE);
}
/**
* {@inheritdoc}
*/
public function request($method, $uri, array $options = []) {
public function request($method, $uri, array $options = []): ResponseInterface {
throw new \Exception(static::EXCEPTION_MESSAGE);
}
/**
* {@inheritdoc}
*/
public function requestAsync($method, $uri, array $options = []) {
public function requestAsync($method, $uri, array $options = []): PromiseInterface {
throw new \Exception(static::EXCEPTION_MESSAGE);
}
/**
* {@inheritdoc}
*/
public function getConfig($option = NULL) {
public function getConfig(?string $option = NULL) {
throw new \Exception(static::EXCEPTION_MESSAGE);
}
......
......@@ -104,7 +104,7 @@ protected function getManagerMock() {
$definitions = $this->mockProviders;
$manager = $this->getMockBuilder('Drupal\video_embed_field\ProviderManager')
->disableOriginalConstructor()
->setMethods(['getDefinitions', 'getDefinition', 'createInstance'])
->onlyMethods(['getDefinitions', 'getDefinition', 'createInstance'])
->getMock();
$manager
->method('getDefinitions')
......
......@@ -2,7 +2,7 @@ name: Video Embed Field
type: module
description: 'Provides a field type for displaying videos from 3rd party providers such as YouTube and Vimeo.'
package: Video Embed Field
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^9.2 || ^10
dependencies:
- drupal:field
- drupal:image
......@@ -11,7 +11,7 @@ dependencies:
test_dependencies:
- colorbox:colorbox
# Information added by Drupal.org packaging script on 2020-04-23
version: '8.x-2.4'
# Information added by Drupal.org packaging script on 2022-12-19
version: '8.x-2.5'
project: 'video_embed_field'
datestamp: 1587686287
datestamp: 1671413313
......@@ -4,6 +4,7 @@ colorbox:
dependencies:
- system/drupal.system
- colorbox/colorbox
- core/once
lazy-load:
js:
......@@ -11,6 +12,7 @@ lazy-load:
dependencies:
- system/drupal.system
- video_embed_field/responsive-video
- core/once
responsive-video:
css:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment