ModuleTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace Cocur\Slugify\Tests\Bridge\ZF2;
  3. use Cocur\Slugify\Bridge\ZF2\Module;
  4. /**
  5. * Class ModuleTest
  6. * @package cocur/slugify
  7. * @subpackage bridge
  8. * @license http://www.opensource.org/licenses/MIT The MIT License
  9. */
  10. class ModuleTest extends \PHPUnit_Framework_TestCase
  11. {
  12. /**
  13. * @var Module
  14. */
  15. private $module;
  16. protected function setUp()
  17. {
  18. $this->module = new Module();
  19. }
  20. /**
  21. * @test
  22. * @covers Cocur\Slugify\Bridge\ZF2\Module::getServiceConfig()
  23. */
  24. public function getServiceConfig()
  25. {
  26. $smConfig = $this->module->getServiceConfig();
  27. $this->assertTrue(is_array($smConfig));
  28. $this->assertArrayHasKey('factories', $smConfig);
  29. $this->assertArrayHasKey('Cocur\Slugify\Slugify', $smConfig['factories']);
  30. $this->assertArrayHasKey('aliases', $smConfig);
  31. $this->assertArrayHasKey('slugify', $smConfig['aliases']);
  32. }
  33. /**
  34. * @test
  35. * @covers Cocur\Slugify\Bridge\ZF2\Module::getViewHelperConfig()
  36. */
  37. public function getViewHelperConfig()
  38. {
  39. $vhConfig = $this->module->getViewHelperConfig();
  40. $this->assertTrue(is_array($vhConfig));
  41. $this->assertArrayHasKey('factories', $vhConfig);
  42. $this->assertArrayHasKey('slugify', $vhConfig['factories']);
  43. }
  44. }