ComposerInstallersTestMediaWikiInstallerTest

The Simple Calendar Composer Installers Test MediaWikiInstallerTest class.

Defined (1)

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

/vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php  
  1. class MediaWikiInstallerTest extends \PHPUnit_Framework_TestCase 
  2. /** 
  3. * @var MediaWikiInstaller 
  4. */ 
  5. private $installer; 
  6.  
  7. public function setUp() 
  8. $this->installer = new MediaWikiInstaller( 
  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. 'mediawiki-extension',  
  26. 'sub-page-list',  
  27. 'SubPageList',  
  28. ),  
  29. array( 
  30. 'mediawiki-extension',  
  31. 'sub-page-list-extension',  
  32. 'SubPageList',  
  33. ),  
  34. array( 
  35. 'mediawiki-extension',  
  36. 'semantic-mediawiki',  
  37. 'SemanticMediawiki',  
  38. ),  
  39. // tests that exactly one '-skin' is cut off, and that skins do not get ucwords treatment like extensions 
  40. array( 
  41. 'mediawiki-skin',  
  42. 'some-skin-skin',  
  43. 'some-skin',  
  44. ),  
  45. // tests that names without '-skin' suffix stay valid 
  46. array( 
  47. 'mediawiki-skin',  
  48. 'someotherskin',  
  49. 'someotherskin',  
  50. ),  
  51. );