ComposerInstallersTestOctoberInstallerTest

The WooCommerce Multilingual Composer Installers Test OctoberInstallerTest class.

Defined (1)

The class is defined in the following location(s).

/vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php  
  1. class OctoberInstallerTest extends \PHPUnit_Framework_TestCase 
  2. /** 
  3. * @var OctoberInstaller 
  4. */ 
  5. private $installer; 
  6.  
  7. public function setUp() 
  8. $this->installer = new OctoberInstaller( 
  9. new Package('NyanCat', '4.2', '4.2'),  
  10. new Composer() 
  11. ); 
  12.  
  13. /** 
  14. * @dataProvider packageNameInflectionProvider 
  15. */ 
  16. public function testInflectPackageVars($type, $name, $expected) 
  17. $this->assertEquals( 
  18. $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)),  
  19. array('name' => $expected, 'type' => $type) 
  20. ); 
  21.  
  22. public function packageNameInflectionProvider() 
  23. return array( 
  24. array( 
  25. 'october-plugin',  
  26. 'subpagelist',  
  27. 'subpagelist',  
  28. ),  
  29. array( 
  30. 'october-plugin',  
  31. 'subpagelist-plugin',  
  32. 'subpagelist',  
  33. ),  
  34. array( 
  35. 'october-plugin',  
  36. 'semanticoctober',  
  37. 'semanticoctober',  
  38. ),  
  39. // tests that exactly one '-theme' is cut off 
  40. array( 
  41. 'october-theme',  
  42. 'some-theme-theme',  
  43. 'some-theme',  
  44. ),  
  45. // tests that names without '-theme' suffix stay valid 
  46. array( 
  47. 'october-theme',  
  48. 'someothertheme',  
  49. 'someothertheme',  
  50. ),  
  51. );