[HttpKernel] tweaked previous merge
This commit is contained in:
parent
171aa1d670
commit
12b7073607
0
src/Symfony/Component/HttpKernel/Config/FileLocator.php
Executable file → Normal file
0
src/Symfony/Component/HttpKernel/Config/FileLocator.php
Executable file → Normal file
@ -12,35 +12,21 @@
|
||||
namespace Symfony\Component\HttpKernel\Tests\Config;
|
||||
|
||||
use Symfony\Component\HttpKernel\Config\FileLocator;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
|
||||
class FileLocatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/** @var KernelInterface */
|
||||
private $kernel;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
$this->kernel = null;
|
||||
}
|
||||
|
||||
public function testLocate()
|
||||
{
|
||||
$this->kernel
|
||||
$kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
|
||||
$kernel
|
||||
->expects($this->atLeastOnce())
|
||||
->method('locateResource')
|
||||
->with('@BundleName/some/path', null, true)
|
||||
->will($this->returnValue('/bundle-name/some/path'));
|
||||
$locator = new FileLocator($this->kernel);
|
||||
$locator = new FileLocator($kernel);
|
||||
$this->assertEquals('/bundle-name/some/path', $locator->locate('@BundleName/some/path'));
|
||||
|
||||
$this->kernel
|
||||
$kernel
|
||||
->expects($this->never())
|
||||
->method('locateResource');
|
||||
$this->setExpectedException('LogicException');
|
||||
@ -49,13 +35,13 @@ class FileLocatorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testLocateWithGlobalResourcePath()
|
||||
{
|
||||
$this->kernel
|
||||
$kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
|
||||
$kernel
|
||||
->expects($this->atLeastOnce())
|
||||
->method('locateResource')
|
||||
->with('@BundleName/some/path', '/global/resource/path', false);
|
||||
|
||||
$locator = new FileLocator($this->kernel, '/global/resource/path');
|
||||
$locator = new FileLocator($kernel, '/global/resource/path');
|
||||
$locator->locate('@BundleName/some/path', null, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user