ComposerInstallersTestAsgardInstallerTest

The Google Analytics by MonsterInsights Composer Installers Test AsgardInstallerTest class.

Defined (1)

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

/vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php  
  1. class AsgardInstallerTest extends \PHPUnit_Framework_TestCase 
  2. /** 
  3. * @var OctoberInstaller 
  4. */ 
  5. private $installer; 
  6.  
  7. public function setUp() 
  8. $this->installer = new AsgardInstaller( 
  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. 'asgard-module',  
  26. 'asgard-module',  
  27. 'Asgard' 
  28. ),  
  29. array( 
  30. 'asgard-module',  
  31. 'blog',  
  32. 'Blog' 
  33. ),  
  34. // tests that exactly one '-theme' is cut off 
  35. array( 
  36. 'asgard-theme',  
  37. 'some-theme-theme',  
  38. 'Some-theme',  
  39. ),  
  40. // tests that names without '-theme' suffix stay valid 
  41. array( 
  42. 'asgard-theme',  
  43. 'someothertheme',  
  44. 'Someothertheme',  
  45. ),  
  46. );