diff --git a/tests/unit/lib/classes/StudipFileloaderTest.php b/tests/unit/lib/classes/StudipFileloaderTest.php index ec457939a3722bd38cb7bf36ee4ff8e56a9ce8a6..1ffe6b572de6f7b816712b539252e04c10e869f7 100644 --- a/tests/unit/lib/classes/StudipFileloaderTest.php +++ b/tests/unit/lib/classes/StudipFileloaderTest.php @@ -8,34 +8,37 @@ * @copyright (c) Authors */ -class StudipFileloaderTestCase extends \Codeception\Test\Unit { - - public function setUp(): void { - ArrayFileStream::set_filesystem( - [ - 'pathto' => [ - 'config-1.php' => '<? $CONF = 17; ' - , 'config-2.php' => '<? $CONF = 17 + $offset; ' - ]]); - - if (!stream_wrapper_register("var", "ArrayFileStream")) { - new Exception("Failed to register protocol"); +class StudipFileloaderTestCase extends \Codeception\Test\Unit +{ + public function setUp(): void + { + ArrayFileStream::set_filesystem([ + 'pathto' => [ + 'config-1.php' => '<?php $CONF = 17; ', + 'config-2.php' => '<?php $CONF = 17 + $offset; ', + ] + ]); + + if (!stream_wrapper_register('var', 'ArrayFileStream')) { + new Exception('Failed to register protocol'); } } - public function tearDown(): void { - stream_wrapper_unregister("var"); + public function tearDown(): void + { + stream_wrapper_unregister('var'); } - public function test_should_inject_vars() { + public function test_should_inject_vars() + { $container = []; StudipFileloader::load('var://pathto/config-1.php', $container); $this->assertEquals(['CONF' => 17], $container); } - public function test_should_inject_vars_twice() { - + public function test_should_inject_vars_twice() + { foreach (range(1,2) as $i) { $container = []; StudipFileloader::load('var://pathto/config-1.php', $container);