Skip to content

Commit d7a8f9e

Browse files
committed
tests: add back test to see if valid configuration can be loaded
1 parent 9d12d49 commit d7a8f9e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tests/DependencyInjection/OverblogDataLoaderExtensionTest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,40 @@ public function testBatchLoadFnNotCallable()
7878
$this->container
7979
);
8080
}
81+
82+
public function testLoadsValidConfiguration()
83+
{
84+
$this->extension->load(
85+
[
86+
[
87+
'defaults' => [
88+
'promise_adapter' => 'overblog_dataloader.react_promise_adapter',
89+
],
90+
'loaders' => [
91+
'users' => [
92+
'alias' => 'users_loader',
93+
'batch_load_fn' => '@app.user:getUsers',
94+
],
95+
'posts' => [
96+
'batch_load_fn' => 'Post::getPosts',
97+
'options' => [
98+
'max_batch_size' => 15,
99+
'batch' => false,
100+
'cache' => false,
101+
'cache_map' => 'app.cache.map',
102+
'cache_key_fn' => '@app.cache',
103+
],
104+
],
105+
'images' => [
106+
'factory' => 'dataloader_factory',
107+
'batch_load_fn' => 'Image\Loader::get',
108+
],
109+
],
110+
],
111+
],
112+
$this->container
113+
);
114+
115+
$this->assertInstanceOf(ContainerBuilder::class, $this->container);
116+
}
81117
}

0 commit comments

Comments
 (0)