ModuleTest.php 1.3 KB

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