diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-07-24 13:11:32 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-07-24 13:11:32 +0200 |
commit | 1f8ee61006a7b3dcc740cb16e5d826fa7c1646c6 (patch) | |
tree | 99b20a3014691fb114ca92054550a5f1f2d70a8f /tests | |
parent | f558b3071fd327ed46f7e6cc3068f261572df453 (diff) | |
parent | a4e39392047c5c49042a0666296efb276c0f88e9 (diff) | |
download | nextcloud-server-1f8ee61006a7b3dcc740cb16e5d826fa7c1646c6.tar.gz nextcloud-server-1f8ee61006a7b3dcc740cb16e5d826fa7c1646c6.zip |
Merge pull request #17755 from owncloud/alias-container-alive
Add registerAlias method to shortcut interface registration #17714
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/appframework/utility/SimpleContainerTest.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lib/appframework/utility/SimpleContainerTest.php b/tests/lib/appframework/utility/SimpleContainerTest.php index c5c522d911f..09857808b9f 100644 --- a/tests/lib/appframework/utility/SimpleContainerTest.php +++ b/tests/lib/appframework/utility/SimpleContainerTest.php @@ -153,6 +153,19 @@ class SimpleContainerTest extends \Test\TestCase { $this->assertEquals('abc', $object->test); } + public function testRegisterAliasParamter() { + $this->container->registerParameter('test', 'abc'); + $this->container->registerAlias('test1', 'test'); + $this->assertEquals('abc', $this->container->query('test1')); + } + + public function testRegisterAliasService() { + $this->container->registerService('test', function() { + return 'abc'; + }); + $this->container->registerAlias('test1', 'test'); + $this->assertEquals('abc', $this->container->query('test1')); + } /** * @expectedException \OCP\AppFramework\QueryException |