Skip to content

Commit

Permalink
add docs, cleanup dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
klausi committed Sep 21, 2023
1 parent b6e8d9b commit 60b9010
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,34 @@ class ImageDerivativeTest extends GraphQLTestBase {
*/
protected static $modules = ['image', 'file'];

/**
* The file system URI under test.
*
* @var string
*/
protected $file_uri;

/**
* The file entity mock.
*
* @var \Drupal\file\FileInterface
*/
protected $file;

/**
* The image style for testing.
*
* @var \Drupal\image\Entity\ImageStyle
*/
protected $style;

/**
* A file entity mock that returns FALSE on access checking.
*
* @var \Drupal\file\FileInterface
*/
protected $file_not_accessible;

/**
* {@inheritdoc}
*/
Expand All @@ -34,8 +62,8 @@ public function setUp(): void {

$this->file->method('getFileUri')->willReturn($this->file_uri);
$this->file->method('access')->willReturn((new AccessResultAllowed())->addCacheTags(['test_tag']));
$this->file->width = 600;
$this->file->height = 400;
@$this->file->width = 600;
@$this->file->height = 400;

$this->style = ImageStyle::create(['name' => 'test_style']);
$effect = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,32 @@
*/
class ImageUrlTest extends GraphQLTestBase {

/**
* The file entity mock.
*
* @var \Drupal\file\FileInterface
*/
protected $file;

/**
* A file entity mock that returns FALSE on access checking.
*
* @var \Drupal\file\FileInterface
*/
protected $file_not_accessible;

/**
* The generated file URI.
*
* @var string
*/
protected $fileUri;

/**
* {@inheritdoc}
*/
public function setUp(): void {
parent::setUp();
$this->dataProducerManager = $this->container->get('plugin.manager.graphql.data_producer');

$this->fileUri = \Drupal::service('file_url_generator')->generateAbsoluteString('public://test.jpg');

Expand Down
12 changes: 0 additions & 12 deletions tests/src/Kernel/DataProducer/EntityMultipleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,6 @@ class EntityMultipleTest extends GraphQLTestBase {
public function setUp(): void {
parent::setUp();

$this->entity = $this->getMockBuilder(NodeInterface::class)
->disableOriginalConstructor()
->getMock();

$this->entity_interface = $this->getMockBuilder(EntityInterface::class)
->disableOriginalConstructor()
->getMock();

$this->user = $this->getMockBuilder(UserInterface::class)
->disableOriginalConstructor()
->getMock();

$content_type = NodeType::create([
'type' => 'lorem',
'name' => 'ipsum',
Expand Down
4 changes: 2 additions & 2 deletions tests/src/Kernel/Framework/PersistedQueriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ protected function setUp(): void {
$this->mockResolver('Link', 'title', 'Ecosia');

/** @var \Drupal\graphql\Plugin\DataProducerPluginManager $manager */
$manager = $this->container->get('plugin.manager.graphql.persisted_query');
/*$manager = $this->container->get('plugin.manager.graphql.persisted_query');
$this->plugin_one = $manager->createInstance('persisted_query_plugin_one');
$this->plugin_two = $manager->createInstance('persisted_query_plugin_two');
$this->plugin_three = $manager->createInstance('persisted_query_plugin_three');
$this->plugin_three = $manager->createInstance('persisted_query_plugin_three');*/
}

/**
Expand Down

0 comments on commit 60b9010

Please sign in to comment.