* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\Config; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpKernel\Config\FileLocator; class FileLocatorTest extends TestCase { public function testLocate() { $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock(); $kernel ->expects($this->atLeastOnce()) ->method('locateResource') ->with('@BundleName/some/path', null, true) ->will($this->returnValue('/bundle-name/some/path')); $locator = new FileLocator($kernel); $this->assertEquals('/bundle-name/some/path', $locator->locate('@BundleName/some/path')); $kernel ->expects($this->never()) ->method('locateResource'); $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('LogicException'); $locator->locate('/some/path'); } public function testLocateWithGlobalResourcePath() { $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock(); $kernel ->expects($this->atLeastOnce()) ->method('locateResource') ->with('@BundleName/some/path', '/global/resource/path', false); $locator = new FileLocator($kernel, '/global/resource/path'); $locator->locate('@BundleName/some/path', null, false); } } __halt_compiler();----SIGNATURE:----eTTp4kr9UyRNs4tDPkC2hWJty+L/jsJW1Zzk9cyV4iyadgDL8Oz8aZcGazAMDgPWZnq7PMaafG0eBoXNnqbPKYPPTeKzK67PUZU40tt6dlWYmEOHHGGhqc/oudjVkebacTHBpCAXMDa+BrPz4dn/IzmOG82VSKevD13p8p4ELPKv4KVXNBrMq/SsMET0zFJeRlrbKSydEhcTKKXH6Nc/pwDF1ctfxNawzQswhe8mC8FGTKLpihQyOV4GQKxRsySjvkfADodmCgGdKKRIVZmIEwrErR7jf5gCl3nRFoZXOJ18H+qEBVUrNaeZzwrIRQWkYlUpodLJl7IclLrH2bChlgrQjMhEZnQxfKGJSxGEexRd17u5YaUOuf5riNTdwWXt8RsiIKVgfTVqV5IAaTJNrGrnRavw/mX/O411LEhg7q7ygFZ7R1jZUaYxl3PUiHM9ZKIWOmsriJkOSWSrb3baZfg7QVLuOFTlQrHq2MIHwPbdEk0s5wSk1p/uID+8aPEdCLN3E34I6vTaHlwSDKrn6QX8wwRzySmVfajjyfNgSaDtRqje0X3aMC81TaJutgKGDbxtQeYrQLagJqZdFb1EW/SHBw7rqgrOYSsAy7A1/EyS7rFI5DEXDDZAAgXJdZHCE7X3g3NzSQmSdB2uFzlzoOQ6CiPlUsa/unGz5OS2Xvo=----ATTACHMENT:----NDkzMjkzODM2MTQ5MTY4NSAyNTY0MjE2ODgyMDE5OTQ5IDk0NjAyMDM5NTg3MTQ3Njg=