PiwikInstallerTest.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace Composer\Installers\Test;
  3. use Composer\Composer;
  4. use Composer\Installers\PiwikInstaller;
  5. use Composer\Package\Package;
  6. use Composer\Package\PackageInterface;
  7. /**
  8. * Class PiwikInstallerTest
  9. *
  10. * @package Composer\Installers\Test
  11. */
  12. class PiwikInstallerTest extends TestCase
  13. {
  14. /**
  15. * @varComposer
  16. */
  17. private $composer;
  18. /**
  19. * @var PackageInterface
  20. */
  21. private $io;
  22. /**
  23. * @var Package
  24. */
  25. private $package;
  26. /**
  27. * setUp
  28. *
  29. * @return void
  30. */
  31. public function setUp()
  32. {
  33. $this->package = new Package('VisitSummary', '1.0', '1.0');
  34. $this->io = $this->getMock('Composer\IO\PackageInterface');
  35. $this->composer = new Composer();
  36. }
  37. /**
  38. * testInflectPackageVars
  39. *
  40. * @return void
  41. */
  42. public function testInflectPackageVars()
  43. {
  44. $installer = new PiwikInstaller($this->package, $this->composer);
  45. $result = $installer->inflectPackageVars(array('name' => 'VisitSummary'));
  46. $this->assertEquals($result, array('name' => 'VisitSummary'));
  47. $installer = new PiwikInstaller($this->package, $this->composer);
  48. $result = $installer->inflectPackageVars(array('name' => 'visit-summary'));
  49. $this->assertEquals($result, array('name' => 'VisitSummary'));
  50. $installer = new PiwikInstaller($this->package, $this->composer);
  51. $result = $installer->inflectPackageVars(array('name' => 'visit_summary'));
  52. $this->assertEquals($result, array('name' => 'VisitSummary'));
  53. }
  54. }