DefaultRouteGeneratorTest.php 774 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /*
  3. * This file is part of the Sonata package.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Sonata\AdminBundle\Tests\Route;
  11. use Sonata\AdminBundle\Route\DefaultRouteGenerator;
  12. class DefaultRouteGeneratorTest extends \PHPUnit_Framework_TestCase
  13. {
  14. public function testGenerate()
  15. {
  16. $router = $this->getMock('\Symfony\Component\Routing\RouterInterface');
  17. $router->expects($this->once())->method('generate')->will($this->returnValue('/foo/bar'));
  18. $generator = new DefaultRouteGenerator($router);
  19. $this->assertEquals('/foo/bar', $generator->generate('foo_bar'));
  20. }
  21. }