4 use PHPUnit\Framework\TestCase;
6 use Dkan\Datastore\Resource;
11 use Procrastinator\Result;
12 use Dkan\Datastore\Importer;
23 $resource =
new Resource(
"blah",
"/",
"text/csv");
25 $jobStore = (
new Chain($this))
26 ->add(JobStore::class,
"retrieve",
"")
27 ->add(Importer::class,
"run", Result::class)
28 ->add(Importer::class,
"getResult", Result::class)
29 ->add(JobStore::class,
"store",
"")
32 $databaseTableFactory = (
new Chain($this))
33 ->add(DatabaseTableFactory::class,
"getInstance", DatabaseTable::class)
36 $jobStoreFactory = (
new Chain($this))
37 ->add(JobStoreFactory::class,
"getInstance", $jobStore)
40 $service =
new Service($resource, $jobStoreFactory, $databaseTableFactory);
43 $this->assertTrue($service->getResult() instanceof Result);