silverstripe-framework/tests/php/Core/Injector/InjectorTest/InjectorTestConfigLocator.php

33 lines
895 B
PHP
Raw Normal View History

2016-10-14 03:30:05 +02:00
<?php
namespace SilverStripe\Core\Tests\Injector\InjectorTest;
use SilverStripe\Core\Injector\SilverStripeServiceConfigurationLocator;
use SilverStripe\Dev\TestOnly;
class InjectorTestConfigLocator extends SilverStripeServiceConfigurationLocator implements TestOnly
{
protected function configFor($name)
{
2016-10-14 03:30:05 +02:00
switch ($name) {
case TestObject::class:
return $this->configs[$name] = [
'class' => ConstructableObject::class,
'constructor' => [
2018-01-16 19:39:30 +01:00
'%$' . OtherTestObject::class
]
];
2016-10-14 03:30:05 +02:00
case 'ConfigConstructor':
return $this->configs[$name] = [
'class' => ConstructableObject::class,
'constructor' => ['value']
];
}
2016-10-14 03:30:05 +02:00
return parent::configFor($name);
}
2016-10-14 03:30:05 +02:00
}