ModuleTest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace Cocur\Slugify\Tests\Bridge\ZF2;
  3. use Cocur\Slugify\Bridge\ZF2\Module;
  4. use Mockery\Adapter\Phpunit\MockeryTestCase;
  5. /**
  6. * Class ModuleTest
  7. * @package cocur/slugify
  8. * @subpackage bridge
  9. * @license http://www.opensource.org/licenses/MIT The MIT License
  10. */
  11. class ModuleTest extends MockeryTestCase
  12. {
  13. /**
  14. * @var Module
  15. */
  16. private $module;
  17. protected function setUp(): void
  18. {
  19. $this->module = new Module();
  20. }
  21. /**
  22. * @covers \Cocur\Slugify\Bridge\ZF2\Module::getServiceConfig()
  23. */
  24. public function testGetServiceConfig()
  25. {
  26. $smConfig = $this->module->getServiceConfig();
  27. $this->assertIsArray($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. * @covers \Cocur\Slugify\Bridge\ZF2\Module::getViewHelperConfig()
  35. */
  36. public function testGetViewHelperConfig()
  37. {
  38. $vhConfig = $this->module->getViewHelperConfig();
  39. $this->assertIsArray($vhConfig);
  40. $this->assertArrayHasKey('factories', $vhConfig);
  41. $this->assertArrayHasKey('slugify', $vhConfig['factories']);
  42. }
  43. }