You are here

public function KernelTest::testLocateResourceOnDirectories in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/KernelTest.php \Symfony\Component\HttpKernel\Tests\KernelTest::testLocateResourceOnDirectories()

File

vendor/symfony/http-kernel/Tests/KernelTest.php, line 576

Class

KernelTest

Namespace

Symfony\Component\HttpKernel\Tests

Code

public function testLocateResourceOnDirectories() {
  $kernel = $this
    ->getKernel(array(
    'getBundle',
  ));
  $kernel
    ->expects($this
    ->exactly(2))
    ->method('getBundle')
    ->will($this
    ->returnValue(array(
    $this
      ->getBundle(__DIR__ . '/Fixtures/FooBundle', null, null, 'FooBundle'),
  )));
  $this
    ->assertEquals(__DIR__ . '/Fixtures/Resources/FooBundle/', $kernel
    ->locateResource('@FooBundle/Resources/', __DIR__ . '/Fixtures/Resources'));
  $this
    ->assertEquals(__DIR__ . '/Fixtures/Resources/FooBundle', $kernel
    ->locateResource('@FooBundle/Resources', __DIR__ . '/Fixtures/Resources'));
  $kernel = $this
    ->getKernel(array(
    'getBundle',
  ));
  $kernel
    ->expects($this
    ->exactly(2))
    ->method('getBundle')
    ->will($this
    ->returnValue(array(
    $this
      ->getBundle(__DIR__ . '/Fixtures/Bundle1Bundle', null, null, 'Bundle1Bundle'),
  )));
  $this
    ->assertEquals(__DIR__ . '/Fixtures/Bundle1Bundle/Resources/', $kernel
    ->locateResource('@Bundle1Bundle/Resources/'));
  $this
    ->assertEquals(__DIR__ . '/Fixtures/Bundle1Bundle/Resources', $kernel
    ->locateResource('@Bundle1Bundle/Resources'));
}