projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updating Media dependent modules to versions compatible with core Media.
[yaffs-website]
/
web
/
modules
/
contrib
/
media_entity_twitter
/
tests
/
src
/
Kernel
/
ThumbnailTest.php
diff --git
a/web/modules/contrib/media_entity_twitter/tests/src/Kernel/ThumbnailTest.php
b/web/modules/contrib/media_entity_twitter/tests/src/Kernel/ThumbnailTest.php
index 850b78a5d70d0ffb2ace0f3dfaf54deffc57596d..a39cda295b4bb436238d40243ab889b954949d90 100644
(file)
--- a/
web/modules/contrib/media_entity_twitter/tests/src/Kernel/ThumbnailTest.php
+++ b/
web/modules/contrib/media_entity_twitter/tests/src/Kernel/ThumbnailTest.php
@@
-5,10
+5,9
@@
namespace Drupal\Tests\media_entity_twitter\Kernel;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\KernelTests\KernelTestBase;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\KernelTests\KernelTestBase;
-use Drupal\media_entity\Entity\Media;
-use Drupal\media_entity\Entity\MediaBundle;
-use Drupal\media_entity\MediaInterface;
-use Drupal\media_entity_twitter\Plugin\MediaEntity\Type\Twitter;
+use Drupal\media\Entity\Media;
+use Drupal\media\Entity\MediaType;
+use Drupal\media_entity_twitter\Plugin\media\Source\Twitter;
use Drupal\media_entity_twitter\TweetFetcherInterface;
/**
use Drupal\media_entity_twitter\TweetFetcherInterface;
/**
@@
-21,21
+20,21
@@
class ThumbnailTest extends KernelTestBase {
/**
* The mocked tweet fetcher.
*
/**
* The mocked tweet fetcher.
*
- * @var TweetFetcherInterface
+ * @var
\Drupal\media_entity_twitter\
TweetFetcherInterface
*/
protected $tweetFetcher;
/**
* The plugin under test.
*
*/
protected $tweetFetcher;
/**
* The plugin under test.
*
- * @var Twitter
+ * @var
\Drupal\media_entity_twitter\Plugin\media\Source\
Twitter
*/
protected $plugin;
/**
* A tweet media entity.
*
*/
protected $plugin;
/**
* A tweet media entity.
*
- * @var MediaInterface
+ * @var
\Drupal\media\
MediaInterface
*/
protected $entity;
*/
protected $entity;
@@
-46,7
+45,7
@@
class ThumbnailTest extends KernelTestBase {
'field',
'file',
'image',
'field',
'file',
'image',
- 'media
_entity
',
+ 'media',
'media_entity_twitter',
'system',
'text',
'media_entity_twitter',
'system',
'text',
@@
-65,10
+64,10
@@
class ThumbnailTest extends KernelTestBase {
$this->tweetFetcher = $this->getMock(TweetFetcherInterface::class);
$this->container->set('media_entity_twitter.tweet_fetcher', $this->tweetFetcher);
$this->tweetFetcher = $this->getMock(TweetFetcherInterface::class);
$this->container->set('media_entity_twitter.tweet_fetcher', $this->tweetFetcher);
- Media
Bundl
e::create([
+ Media
Typ
e::create([
'id' => 'tweet',
'id' => 'tweet',
- '
typ
e' => 'twitter',
- '
typ
e_configuration' => [
+ '
sourc
e' => 'twitter',
+ '
sourc
e_configuration' => [
'source_field' => 'tweet',
'use_twitter_api' => TRUE,
'consumer_key' => $this->randomString(),
'source_field' => 'tweet',
'use_twitter_api' => TRUE,
'consumer_key' => $this->randomString(),
@@
-97,9
+96,9
@@
class ThumbnailTest extends KernelTestBase {
$this->plugin = Twitter::create(
$this->container,
$this->plugin = Twitter::create(
$this->container,
- Media
Bundle::load('tweet')->getTypeConfiguration(
),
+ Media
Type::load('tweet')->get('source_configuration'
),
'twitter',
'twitter',
- []
+ MediaType::load('tweet')->getSource()->getPluginDefinition()
);
$dir = $this->container
);
$dir = $this->container
@@
-128,7
+127,7
@@
class ThumbnailTest extends KernelTestBase {
$uri = 'public://twitter-thumbnails/12345.ico';
touch($uri);
$uri = 'public://twitter-thumbnails/12345.ico';
touch($uri);
- $this->assertEquals($uri, $this->plugin->
thumbnail($this->entity
));
+ $this->assertEquals($uri, $this->plugin->
getMetadata($this->entity, 'thumbnail_uri'
));
}
/**
}
/**
@@
-147,7
+146,7
@@
class ThumbnailTest extends KernelTestBase {
],
]);
],
]);
- $this->plugin->
thumbnail($this->entity
);
+ $this->plugin->
getMetadata($this->entity, 'thumbnail_uri'
);
$this->assertFileExists('public://twitter-thumbnails/12345.ico');
}
$this->assertFileExists('public://twitter-thumbnails/12345.ico');
}
@@
-156,8
+155,8
@@
class ThumbnailTest extends KernelTestBase {
*/
public function testNoLocalImage() {
$this->assertEquals(
*/
public function testNoLocalImage() {
$this->assertEquals(
-
$this->plugin->getDefaultThumbnail()
,
- $this->plugin->
thumbnail($this->entity
)
+
'/twitter.png'
,
+ $this->plugin->
getMetadata($this->entity, 'thumbnail_uri'
)
);
}
);
}
@@
-169,7
+168,7
@@
class ThumbnailTest extends KernelTestBase {
$configuration['generate_thumbnails'] = TRUE;
$this->plugin->setConfiguration($configuration);
$configuration['generate_thumbnails'] = TRUE;
$this->plugin->setConfiguration($configuration);
- $uri = $this->plugin->
thumbnail($this->entity
);
+ $uri = $this->plugin->
getMetadata($this->entity, 'thumbnail_uri'
);
$this->assertFileExists($uri);
}
$this->assertFileExists($uri);
}