Open Data Catalog v2.0.0
DatasetTest.php
Go to the documentation of this file.
1 <?php
2 
4 
5 use Contracts\Mock\Storage\Memory;
6 use Drupal\Core\DependencyInjection\Container;
7 use PHPUnit\Framework\TestCase;
8 use MockChain\Chain;
9 use MockChain\Options;
12 
19 class DatasetTest extends TestCase {
20 
24  public function test() {
25  $container = (new Chain($this))
26  ->add(Container::class, "get", (new Options())
27  ->add('dkan_metastore.service', Service::class)
28  ->index(0)
29  )
30  ->add(Service::class, "post", "1");
31 
32  \Drupal::setContainer($container->getMock());
33 
34  $hashStorage = new Memory();
35  $itemStorage = new Memory();
36  $load = new Dataset((object) ["identifier" => "plan"], $hashStorage, $itemStorage);
37  $load->run((object) ["identifier" => "1"]);
38 
39  // We just want to run the code.
40  $this->assertTrue(TRUE);
41  }
42 
43 }
Drupal\Tests\dkan_harvest\Unit\Extract\DatasetTest
Definition: DatasetTest.php:19
Drupal\dkan_metastore\Service
Definition: Service.php:20
Drupal\Tests\dkan_harvest\Unit\Extract
Definition: DatasetTest.php:3
Drupal\Tests\dkan_harvest\Unit\Extract\DatasetTest\test
test()
Definition: DatasetTest.php:24
Drupal\dkan_harvest\Load\Dataset
Definition: Dataset.php:11