SlugifySilexProviderTest.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * This file is part of cocur/slugify.
  4. *
  5. * (c) Florian Eckerstorfer <florian@eckerstorfer.co>
  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 Cocur\Slugify\Bridge\Silex;
  11. use Cocur\Slugify\Bridge\Silex\SlugifyServiceProvider;
  12. /**
  13. * SlugifyServiceProviderTest
  14. *
  15. * @category test
  16. * @package cocur/slugify
  17. * @subpackage bridge
  18. * @author Florian Eckerstorfer <florian@eckerstorfer.co>
  19. * @copyright 2012-2014 Florian Eckerstorfer
  20. * @license http://www.opensource.org/licenses/MIT The MIT License
  21. * @group unit
  22. */
  23. class SlugifyServiceProviderTest extends \PHPUnit_Framework_TestCase
  24. {
  25. /** @var SlugifyServiceProvider */
  26. private $provider;
  27. public function setUp()
  28. {
  29. $this->provider = new SlugifyServiceProvider();
  30. }
  31. /**
  32. * @test
  33. * @covers Cocur\Slugify\Bridge\Silex\SlugifyServiceProvider::boot()
  34. */
  35. public function boot()
  36. {
  37. // it seems like Application is not mockable.
  38. $app = new \Silex\Application();
  39. $this->provider->boot($app);
  40. }
  41. /**
  42. * @test
  43. * @covers Cocur\Slugify\Bridge\Silex\SlugifyServiceProvider::register()
  44. */
  45. public function register()
  46. {
  47. // it seems like Application is not mockable.
  48. $app = new \Silex\Application();
  49. $this->provider->register($app);
  50. $this->assertArrayHasKey('slugify', $app);
  51. $this->assertInstanceOf('Cocur\Slugify\Slugify', $app['slugify']);
  52. }
  53. }