ComposerInstallersTestInstallerTest

The WooCommerce Multilingual Composer Installers Test InstallerTest class.

Defined (1)

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

/vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php  
  1. class InstallerTest extends TestCase 
  2. private $composer; 
  3. private $config; 
  4. private $vendorDir; 
  5. private $binDir; 
  6. private $dm; 
  7. private $repository; 
  8. private $io; 
  9. private $fs; 
  10.  
  11. /** 
  12. * setUp 
  13. * @return void 
  14. */ 
  15. public function setUp() 
  16. $this->fs = new Filesystem; 
  17.  
  18. $this->composer = new Composer(); 
  19. $this->config = new Config(); 
  20. $this->composer->setConfig($this->config); 
  21.  
  22. $this->vendorDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-vendor'; 
  23. $this->ensureDirectoryExistsAndClear($this->vendorDir); 
  24.  
  25. $this->binDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-bin'; 
  26. $this->ensureDirectoryExistsAndClear($this->binDir); 
  27.  
  28. $this->config->merge(array( 
  29. 'config' => array( 
  30. 'vendor-dir' => $this->vendorDir,  
  31. 'bin-dir' => $this->binDir,  
  32. ),  
  33. )); 
  34.  
  35. $this->dm = $this->getMockBuilder('Composer\Downloader\DownloadManager') 
  36. ->disableOriginalConstructor() 
  37. ->getMock(); 
  38. $this->composer->setDownloadManager($this->dm); 
  39.  
  40. $this->repository = $this->getMock('Composer\Repository\InstalledRepositoryInterface'); 
  41. $this->io = $this->getMock('Composer\IO\IOInterface'); 
  42.  
  43. /** 
  44. * tearDown 
  45. * @return void 
  46. */ 
  47. public function tearDown() 
  48. $this->fs->removeDirectory($this->vendorDir); 
  49. $this->fs->removeDirectory($this->binDir); 
  50.  
  51. /** 
  52. * testSupports 
  53. * @return void 
  54. * @dataProvider dataForTestSupport 
  55. */ 
  56. public function testSupports($type, $expected) 
  57. $installer = new Installer($this->io, $this->composer); 
  58. $this->assertSame($expected, $installer->supports($type), sprintf('Failed to show support for %s', $type)); 
  59.  
  60. /** 
  61. * dataForTestSupport 
  62. */ 
  63. public function dataForTestSupport() 
  64. return array( 
  65. array('agl-module', true),  
  66. array('aimeos-extension', true),  
  67. array('annotatecms-module', true),  
  68. array('annotatecms-component', true),  
  69. array('annotatecms-service', true),  
  70. array('attogram-module', true),  
  71. array('bitrix-module', true),  
  72. array('bitrix-component', true),  
  73. array('bitrix-theme', true),  
  74. array('bonefish-package', true),  
  75. array('cakephp', false),  
  76. array('cakephp-', false),  
  77. array('cakephp-app', false),  
  78. array('cakephp-plugin', true),  
  79. array('chef-cookbook', true),  
  80. array('chef-role', true),  
  81. array('cockpit-module', true),  
  82. array('codeigniter-app', false),  
  83. array('codeigniter-library', true),  
  84. array('codeigniter-third-party', true),  
  85. array('codeigniter-module', true),  
  86. array('concrete5-block', true),  
  87. array('concrete5-package', true),  
  88. array('concrete5-theme', true),  
  89. array('concrete5-update', true),  
  90. array('craft-plugin', true),  
  91. array('croogo-plugin', true),  
  92. array('croogo-theme', true),  
  93. array('decibel-app', true),  
  94. array('dokuwiki-plugin', true),  
  95. array('dokuwiki-template', true),  
  96. array('drupal-module', true),  
  97. array('dolibarr-module', true),  
  98. array('ee3-theme', true),  
  99. array('ee3-addon', true),  
  100. array('ee2-theme', true),  
  101. array('ee2-addon', true),  
  102. array('elgg-plugin', true),  
  103. array('fuel-module', true),  
  104. array('fuel-package', true),  
  105. array('fuel-theme', true),  
  106. array('fuelphp-component', true),  
  107. array('hurad-plugin', true),  
  108. array('hurad-theme', true),  
  109. array('imagecms-template', true),  
  110. array('imagecms-module', true),  
  111. array('imagecms-library', true),  
  112. array('joomla-library', true),  
  113. array('kirby-plugin', true),  
  114. array('kohana-module', true),  
  115. array('laravel-library', true),  
  116. array('lithium-library', true),  
  117. array('magento-library', true),  
  118. array('mako-package', true),  
  119. array('modxevo-snippet', true),  
  120. array('modxevo-plugin', true),  
  121. array('modxevo-module', true),  
  122. array('modxevo-template', true),  
  123. array('modxevo-lib', true),  
  124. array('mediawiki-extension', true),  
  125. array('mediawiki-skin', true),  
  126. array('microweber-module', true),  
  127. array('modulework-module', true),  
  128. array('moodle-mod', true),  
  129. array('october-module', true),  
  130. array('october-plugin', true),  
  131. array('piwik-plugin', true),  
  132. array('phpbb-extension', true),  
  133. array('pimcore-plugin', true),  
  134. array('plentymarkets-plugin', true),  
  135. array('ppi-module', true),  
  136. array('prestashop-module', true),  
  137. array('prestashop-theme', true),  
  138. array('puppet-module', true),  
  139. array('radphp-bundle', true),  
  140. array('redaxo-addon', true),  
  141. array('redaxo-bestyle-plugin', true),  
  142. array('reindex-theme', true),  
  143. array('reindex-plugin', true),  
  144. array('roundcube-plugin', true),  
  145. array('shopware-backend-plugin', true),  
  146. array('shopware-core-plugin', true),  
  147. array('shopware-frontend-plugin', true),  
  148. array('shopware-theme', true),  
  149. array('shopware-plugin', true),  
  150. array('shopware-frontend-theme', true),  
  151. array('silverstripe-module', true),  
  152. array('silverstripe-theme', true),  
  153. array('smf-module', true),  
  154. array('smf-theme', true),  
  155. array('symfony1-plugin', true),  
  156. array('thelia-module', true),  
  157. array('thelia-frontoffice-template', true),  
  158. array('thelia-backoffice-template', true),  
  159. array('thelia-email-template', true),  
  160. array('tusk-task', true),  
  161. array('tusk-asset', true),  
  162. array('typo3-flow-plugin', true),  
  163. array('typo3-cms-extension', true),  
  164. array('vanilla-plugin', true),  
  165. array('vanilla-theme', true),  
  166. array('whmcs-gateway', true),  
  167. array('wolfcms-plugin', true),  
  168. array('wordpress-plugin', true),  
  169. array('wordpress-core', false),  
  170. array('yawik-module', true),  
  171. array('zend-library', true),  
  172. array('zikula-module', true),  
  173. array('zikula-theme', true),  
  174. array('kodicms-plugin', true),  
  175. array('kodicms-media', true),  
  176. array('phifty-bundle', true),  
  177. array('phifty-library', true),  
  178. array('phifty-framework', true),  
  179. ); 
  180.  
  181. /** 
  182. * testInstallPath 
  183. * @dataProvider dataForTestInstallPath 
  184. */ 
  185. public function testInstallPath($type, $path, $name, $version = '1.0.0') 
  186. $installer = new Installer($this->io, $this->composer); 
  187. $package = new Package($name, $version, $version); 
  188.  
  189. $package->setType($type); 
  190. $result = $installer->getInstallPath($package); 
  191. $this->assertEquals($path, $result); 
  192.  
  193. /** 
  194. * dataFormTestInstallPath 
  195. */ 
  196. public function dataForTestInstallPath() 
  197. return array( 
  198. array('agl-module', 'More/MyTestPackage/', 'agl/my_test-package'),  
  199. array('aimeos-extension', 'ext/ai-test/', 'author/ai-test'),  
  200. array('annotatecms-module', 'addons/modules/my_module/', 'vysinsky/my_module'),  
  201. array('annotatecms-component', 'addons/components/my_component/', 'vysinsky/my_component'),  
  202. array('annotatecms-service', 'addons/services/my_service/', 'vysinsky/my_service'),  
  203. array('attogram-module', 'modules/my_module/', 'author/my_module'),  
  204. array('bitrix-module', 'bitrix/modules/my_module/', 'author/my_module'),  
  205. array('bitrix-component', 'bitrix/components/my_component/', 'author/my_component'),  
  206. array('bitrix-theme', 'bitrix/templates/my_theme/', 'author/my_theme'),  
  207. array('bitrix-d7-module', 'bitrix/modules/author.my_module/', 'author/my_module'),  
  208. array('bitrix-d7-component', 'bitrix/components/author/my_component/', 'author/my_component'),  
  209. array('bitrix-d7-template', 'bitrix/templates/author_my_template/', 'author/my_template'),  
  210. array('bonefish-package', 'Packages/bonefish/package/', 'bonefish/package'),  
  211. array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),  
  212. array('chef-cookbook', 'Chef/mre/my_cookbook/', 'mre/my_cookbook'),  
  213. array('chef-role', 'Chef/roles/my_role/', 'mre/my_role'),  
  214. array('cockpit-module', 'cockpit/modules/addons/My_module/', 'piotr-cz/cockpit-my_module'),  
  215. array('codeigniter-library', 'application/libraries/my_package/', 'shama/my_package'),  
  216. array('codeigniter-module', 'application/modules/my_package/', 'shama/my_package'),  
  217. array('concrete5-block', 'blocks/concrete5_block/', 'remo/concrete5_block'),  
  218. array('concrete5-package', 'packages/concrete5_package/', 'remo/concrete5_package'),  
  219. array('concrete5-theme', 'themes/concrete5_theme/', 'remo/concrete5_theme'),  
  220. array('concrete5-update', 'updates/concrete5/', 'concrete5/concrete5'),  
  221. array('craft-plugin', 'craft/plugins/my_plugin/', 'mdcpepper/my_plugin'),  
  222. array('croogo-plugin', 'Plugin/Sitemaps/', 'fahad19/sitemaps'),  
  223. array('croogo-theme', 'View/Themed/Readable/', 'rchavik/readable'),  
  224. array('decibel-app', 'app/someapp/', 'author/someapp'),  
  225. array('dokuwiki-plugin', 'lib/plugins/someplugin/', 'author/someplugin'),  
  226. array('dokuwiki-template', 'lib/tpl/sometemplate/', 'author/sometemplate'),  
  227. array('dolibarr-module', 'htdocs/custom/my_module/', 'shama/my_module'),  
  228. array('drupal-module', 'modules/my_module/', 'shama/my_module'),  
  229. array('drupal-theme', 'themes/my_module/', 'shama/my_module'),  
  230. array('drupal-profile', 'profiles/my_module/', 'shama/my_module'),  
  231. array('drupal-drush', 'drush/my_module/', 'shama/my_module'),  
  232. array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),  
  233. array('ee3-addon', 'system/user/addons/ee_theme/', 'author/ee_theme'),  
  234. array('ee3-theme', 'themes/user/ee_package/', 'author/ee_package'),  
  235. array('ee2-addon', 'system/expressionengine/third_party/ee_theme/', 'author/ee_theme'),  
  236. array('ee2-theme', 'themes/third_party/ee_package/', 'author/ee_package'),  
  237. array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),  
  238. array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),  
  239. array('fuel-theme', 'fuel/app/themes/theme/', 'fuel/theme'),  
  240. array('fuelphp-component', 'components/demo/', 'fuelphp/demo'),  
  241. array('hurad-plugin', 'plugins/Akismet/', 'atkrad/akismet'),  
  242. array('hurad-theme', 'plugins/Hurad2013/', 'atkrad/Hurad2013'),  
  243. array('imagecms-template', 'templates/my_template/', 'shama/my_template'),  
  244. array('imagecms-module', 'application/modules/my_module/', 'shama/my_module'),  
  245. array('imagecms-library', 'application/libraries/my_library/', 'shama/my_library'),  
  246. array('joomla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),  
  247. array('kirby-plugin', 'site/plugins/my_plugin/', 'shama/my_plugin'),  
  248. array('kohana-module', 'modules/my_package/', 'shama/my_package'),  
  249. array('laravel-library', 'libraries/my_package/', 'shama/my_package'),  
  250. array('lithium-library', 'libraries/li3_test/', 'user/li3_test'),  
  251. array('magento-library', 'lib/foo/', 'test/foo'),  
  252. array('modxevo-snippet', 'assets/snippets/my_snippet/', 'shama/my_snippet'),  
  253. array('modxevo-plugin', 'assets/plugins/my_plugin/', 'shama/my_plugin'),  
  254. array('modxevo-module', 'assets/modules/my_module/', 'shama/my_module'),  
  255. array('modxevo-template', 'assets/templates/my_template/', 'shama/my_template'),  
  256. array('modxevo-lib', 'assets/lib/my_lib/', 'shama/my_lib'),  
  257. array('mako-package', 'app/packages/my_package/', 'shama/my_package'),  
  258. array('mediawiki-extension', 'extensions/APC/', 'author/APC'),  
  259. array('mediawiki-extension', 'extensions/APC/', 'author/APC-extension'),  
  260. array('mediawiki-extension', 'extensions/UploadWizard/', 'author/upload-wizard'),  
  261. array('mediawiki-extension', 'extensions/SyntaxHighlight_GeSHi/', 'author/syntax-highlight_GeSHi'),  
  262. array('mediawiki-skin', 'skins/someskin/', 'author/someskin-skin'),  
  263. array('mediawiki-skin', 'skins/someskin/', 'author/someskin'),  
  264. array('microweber-module', 'userfiles/modules/my-thing/', 'author/my-thing-module'),  
  265. array('modulework-module', 'modules/my_package/', 'shama/my_package'),  
  266. array('moodle-mod', 'mod/my_package/', 'shama/my_package'),  
  267. array('october-module', 'modules/my_plugin/', 'shama/my_plugin'),  
  268. array('october-plugin', 'plugins/shama/my_plugin/', 'shama/my_plugin'),  
  269. array('october-theme', 'themes/my_theme/', 'shama/my_theme'),  
  270. array('piwik-plugin', 'plugins/VisitSummary/', 'shama/visit-summary'),  
  271. array('prestashop-module', 'modules/a-module/', 'vendor/a-module'),  
  272. array('prestashop-theme', 'themes/a-theme/', 'vendor/a-theme'),  
  273. array('phpbb-extension', 'ext/test/foo/', 'test/foo'),  
  274. array('phpbb-style', 'styles/foo/', 'test/foo'),  
  275. array('phpbb-language', 'language/foo/', 'test/foo'),  
  276. array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),  
  277. array('plentymarkets-plugin', 'HelloWorld/', 'plugin-hello-world'),  
  278. array('ppi-module', 'modules/foo/', 'test/foo'),  
  279. array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),  
  280. array('radphp-bundle', 'src/Migration/', 'atkrad/migration'),  
  281. array('redaxo-addon', 'redaxo/include/addons/my_plugin/', 'shama/my_plugin'),  
  282. array('redaxo-bestyle-plugin', 'redaxo/include/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),  
  283. array('reindex-theme', 'themes/my_module/', 'author/my_module'),  
  284. array('reindex-plugin', 'plugins/my_module/', 'author/my_module'),  
  285. array('roundcube-plugin', 'plugins/base/', 'test/base'),  
  286. array('roundcube-plugin', 'plugins/replace_dash/', 'test/replace-dash'),  
  287. array('shopware-backend-plugin', 'engine/Shopware/Plugins/Local/Backend/ShamaMyBackendPlugin/', 'shama/my-backend-plugin'),  
  288. array('shopware-core-plugin', 'engine/Shopware/Plugins/Local/Core/ShamaMyCorePlugin/', 'shama/my-core-plugin'),  
  289. array('shopware-frontend-plugin', 'engine/Shopware/Plugins/Local/Frontend/ShamaMyFrontendPlugin/', 'shama/my-frontend-plugin'),  
  290. array('shopware-theme', 'templates/my_theme/', 'shama/my-theme'),  
  291. array('shopware-frontend-theme', 'themes/Frontend/ShamaMyFrontendTheme/', 'shama/my-frontend-theme'),  
  292. array('shopware-plugin', 'custom/plugins/ShamaMyPlugin/', 'shama/my-plugin'),  
  293. array('silverstripe-module', 'my_module/', 'shama/my_module'),  
  294. array('silverstripe-module', 'sapphire/', 'silverstripe/framework', '2.4.0'),  
  295. array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0'),  
  296. array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0-rc1'),  
  297. array('silverstripe-module', 'framework/', 'silverstripe/framework', 'my/branch'),  
  298. array('silverstripe-theme', 'themes/my_theme/', 'shama/my_theme'),  
  299. array('smf-module', 'Sources/my_module/', 'shama/my_module'),  
  300. array('smf-theme', 'Themes/my_theme/', 'shama/my_theme'),  
  301. array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sfShamaPlugin'),  
  302. array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sf-shama-plugin'),  
  303. array('thelia-module', 'local/modules/my_module/', 'shama/my_module'),  
  304. array('thelia-frontoffice-template', 'templates/frontOffice/my_template_fo/', 'shama/my_template_fo'),  
  305. array('thelia-backoffice-template', 'templates/backOffice/my_template_bo/', 'shama/my_template_bo'),  
  306. array('thelia-email-template', 'templates/email/my_template_email/', 'shama/my_template_email'),  
  307. array('tusk-task', '.tusk/tasks/my_task/', 'shama/my_task'),  
  308. array('typo3-flow-package', 'Packages/Application/my_package/', 'shama/my_package'),  
  309. array('typo3-flow-build', 'Build/my_package/', 'shama/my_package'),  
  310. array('typo3-cms-extension', 'typo3conf/ext/my_extension/', 'shama/my_extension'),  
  311. array('vanilla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),  
  312. array('vanilla-theme', 'themes/my_theme/', 'shama/my_theme'),  
  313. array('whmcs-gateway', 'modules/gateways/gateway_name/', 'vendor/gateway_name'),  
  314. array('wolfcms-plugin', 'wolf/plugins/my_plugin/', 'shama/my_plugin'),  
  315. array('wordpress-plugin', 'wp-content/plugins/my_plugin/', 'shama/my_plugin'),  
  316. array('wordpress-muplugin', 'wp-content/mu-plugins/my_plugin/', 'shama/my_plugin'),  
  317. array('zend-extra', 'extras/library/zend_test/', 'shama/zend_test'),  
  318. array('zikula-module', 'modules/my-test_module/', 'my/test_module'),  
  319. array('zikula-theme', 'themes/my-test_theme/', 'my/test_theme'),  
  320. array('kodicms-media', 'cms/media/vendor/my_media/', 'shama/my_media'),  
  321. array('kodicms-plugin', 'cms/plugins/my_plugin/', 'shama/my_plugin'),  
  322. array('phifty-bundle', 'bundles/core/', 'shama/core'),  
  323. array('phifty-library', 'libraries/my-lib/', 'shama/my-lib'),  
  324. array('phifty-framework', 'frameworks/my-framework/', 'shama/my-framework'),  
  325. array('yawik-module', 'module/MyModule/', 'shama/my_module'),  
  326. ); 
  327.  
  328. /** 
  329. * testGetCakePHPInstallPathException 
  330. * @return void 
  331. * @expectedException \InvalidArgumentException 
  332. */ 
  333. public function testGetCakePHPInstallPathException() 
  334. $installer = new Installer($this->io, $this->composer); 
  335. $package = new Package('shama/ftp', '1.0.0', '1.0.0'); 
  336.  
  337. $package->setType('cakephp-whoops'); 
  338. $result = $installer->getInstallPath($package); 
  339.  
  340. /** 
  341. * testCustomInstallPath 
  342. */ 
  343. public function testCustomInstallPath() 
  344. $installer = new Installer($this->io, $this->composer); 
  345. $package = new Package('shama/ftp', '1.0.0', '1.0.0'); 
  346. $package->setType('cakephp-plugin'); 
  347. $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0'); 
  348. $this->composer->setPackage($consumerPackage); 
  349. $consumerPackage->setExtra(array( 
  350. 'installer-paths' => array( 
  351. 'my/custom/path/{$name}/' => array( 
  352. 'shama/ftp',  
  353. 'foo/bar',  
  354. ),  
  355. ),  
  356. )); 
  357. $result = $installer->getInstallPath($package); 
  358. $this->assertEquals('my/custom/path/Ftp/', $result); 
  359.  
  360. /** 
  361. * testCustomInstallerName 
  362. */ 
  363. public function testCustomInstallerName() 
  364. $installer = new Installer($this->io, $this->composer); 
  365. $package = new Package('shama/cakephp-ftp-plugin', '1.0.0', '1.0.0'); 
  366. $package->setType('cakephp-plugin'); 
  367. $package->setExtra(array( 
  368. 'installer-name' => 'FTP',  
  369. )); 
  370. $result = $installer->getInstallPath($package); 
  371. $this->assertEquals('Plugin/FTP/', $result); 
  372.  
  373. /** 
  374. * testCustomTypePath 
  375. */ 
  376. public function testCustomTypePath() 
  377. $installer = new Installer($this->io, $this->composer); 
  378. $package = new Package('slbmeh/my_plugin', '1.0.0', '1.0.0'); 
  379. $package->setType('wordpress-plugin'); 
  380. $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0'); 
  381. $this->composer->setPackage($consumerPackage); 
  382. $consumerPackage->setExtra(array( 
  383. 'installer-paths' => array( 
  384. 'my/custom/path/{$name}/' => array( 
  385. 'type:wordpress-plugin' 
  386. ),  
  387. ),  
  388. )); 
  389. $result = $installer->getInstallPath($package); 
  390. $this->assertEquals('my/custom/path/my_plugin/', $result); 
  391.  
  392. /** 
  393. * testVendorPath 
  394. */ 
  395. public function testVendorPath() 
  396. $installer = new Installer($this->io, $this->composer); 
  397. $package = new Package('penyaskito/my_module', '1.0.0', '1.0.0'); 
  398. $package->setType('drupal-module'); 
  399. $consumerPackage = new RootPackage('drupal/drupal', '1.0.0', '1.0.0'); 
  400. $this->composer->setPackage($consumerPackage); 
  401. $consumerPackage->setExtra(array( 
  402. 'installer-paths' => array( 
  403. 'modules/custom/{$name}/' => array( 
  404. 'vendor:penyaskito' 
  405. ),  
  406. ),  
  407. )); 
  408. $result = $installer->getInstallPath($package); 
  409. $this->assertEquals('modules/custom/my_module/', $result); 
  410.  
  411. /** 
  412. * testNoVendorName 
  413. */ 
  414. public function testNoVendorName() 
  415. $installer = new Installer($this->io, $this->composer); 
  416. $package = new Package('sfPhpunitPlugin', '1.0.0', '1.0.0'); 
  417.  
  418. $package->setType('symfony1-plugin'); 
  419. $result = $installer->getInstallPath($package); 
  420. $this->assertEquals('plugins/sfPhpunitPlugin/', $result); 
  421.  
  422. /** 
  423. * testTypo3Inflection 
  424. */ 
  425. public function testTypo3Inflection() 
  426. $installer = new Installer($this->io, $this->composer); 
  427. $package = new Package('typo3/fluid', '1.0.0', '1.0.0'); 
  428.  
  429. $package->setAutoload(array( 
  430. 'psr-0' => array( 
  431. 'TYPO3\\Fluid' => 'Classes',  
  432. ),  
  433. )); 
  434.  
  435. $package->setType('typo3-flow-package'); 
  436. $result = $installer->getInstallPath($package); 
  437. $this->assertEquals('Packages/Application/TYPO3.Fluid/', $result); 
  438.  
  439. public function testUninstallAndDeletePackageFromLocalRepo() 
  440. $package = new Package('foo', '1.0.0', '1.0.0'); 
  441.  
  442. $installer = $this->getMock('Composer\Installers\Installer', array('getInstallPath'), array($this->io, $this->composer)); 
  443. $installer->expects($this->once())->method('getInstallPath')->with($package)->will($this->returnValue(sys_get_temp_dir().'/foo')); 
  444.  
  445. $repo = $this->getMock('Composer\Repository\InstalledRepositoryInterface'); 
  446. $repo->expects($this->once())->method('hasPackage')->with($package)->will($this->returnValue(true)); 
  447. $repo->expects($this->once())->method('removePackage')->with($package); 
  448.  
  449. $installer->uninstall($repo, $package);