[Config] Loader::import must return imported data
This commit is contained in:
parent
aad8136cd1
commit
8bb3208ab8
@ -47,10 +47,12 @@ abstract class Loader implements LoaderInterface
|
|||||||
*
|
*
|
||||||
* @param mixed $resource A Resource
|
* @param mixed $resource A Resource
|
||||||
* @param string $type The resource type
|
* @param string $type The resource type
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function import($resource, $type = null)
|
public function import($resource, $type = null)
|
||||||
{
|
{
|
||||||
$this->resolve($resource)->load($resource, $type);
|
return $this->resolve($resource)->load($resource, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,6 +55,15 @@ class LoaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertInstanceOf('Symfony\Component\Config\Exception\FileLoaderLoadException', $e, '->resolve() throws a FileLoaderLoadException if the resource cannot be loaded');
|
$this->assertInstanceOf('Symfony\Component\Config\Exception\FileLoaderLoadException', $e, '->resolve() throws a FileLoaderLoadException if the resource cannot be loaded');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testImport()
|
||||||
|
{
|
||||||
|
$loader = $this->getMock('Symfony\Component\Config\Loader\Loader', array('supports', 'load'));
|
||||||
|
$loader->expects($this->once())->method('supports')->will($this->returnValue(true));
|
||||||
|
$loader->expects($this->once())->method('load')->will($this->returnValue('yes'));
|
||||||
|
|
||||||
|
$this->assertEquals('yes', $loader->import('foo'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ProjectLoader1 extends Loader
|
class ProjectLoader1 extends Loader
|
||||||
|
Reference in New Issue
Block a user