Skip to content

Commit ba75d27

Browse files
committed
Add test for decorator support
1 parent d6eadfe commit ba75d27

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/DI/AutoDIExtensionTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ public function testRegisterOnConfiguration()
106106
$this->assertCount(1, $container->findByType(Tests\Dir02\SimpleService::class));
107107
}
108108

109+
public function testWorksWithNetteDIDecorator()
110+
{
111+
$container = $this->getContainer(__DIR__ . '/decorator.neon');
112+
113+
$this->assertCount(1, $container->findByTag('decorated'));
114+
}
115+
109116
/**
110117
* @param string $configFile
111118
* @param string $appDir

tests/DI/decorator.neon

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
autoDI:
2+
registerOnConfiguration: true
3+
services:
4+
- class: Fmasa\AutoDI\Tests\Dir01\SimpleService
5+
6+
decorator:
7+
Fmasa\AutoDI\Tests\Dir01\SimpleService:
8+
tags: [ decorated ]
9+
10+
di:
11+
debugger: false

0 commit comments

Comments
 (0)