update-allow-list-patterns.test 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. --TEST--
  2. Update with a package whitelist only updates those corresponding to the pattern
  3. --COMPOSER--
  4. {
  5. "repositories": [
  6. {
  7. "type": "package",
  8. "package": [
  9. { "name": "vendor/test-package", "version": "2.0" },
  10. { "name": "vendor/not-me", "version": "2.0" },
  11. { "name": "exact/test-package", "version": "2.0" },
  12. { "name": "notexact/testpackage", "version": "2.0" },
  13. { "name": "all/package1", "version": "2.0" },
  14. { "name": "all/package2", "version": "2.0" },
  15. { "name": "another/another", "version": "2.0" },
  16. { "name": "no/regexp", "version": "2.0" }
  17. ]
  18. }
  19. ],
  20. "require": {
  21. "vendor/test-package": "*.*",
  22. "vendor/not-me": "*.*",
  23. "exact/test-package": "*.*",
  24. "notexact/testpackage": "*.*",
  25. "all/package1": "*.*",
  26. "all/package2": "*.*",
  27. "another/another": "*.*",
  28. "no/regexp": "*.*"
  29. }
  30. }
  31. --INSTALLED--
  32. [
  33. { "name": "vendor/test-package", "version": "1.0" },
  34. { "name": "vendor/not-me", "version": "1.0" },
  35. { "name": "exact/test-package", "version": "1.0" },
  36. { "name": "notexact/testpackage", "version": "1.0" },
  37. { "name": "all/package1", "version": "1.0" },
  38. { "name": "all/package2", "version": "1.0" },
  39. { "name": "another/another", "version": "1.0" },
  40. { "name": "no/regexp", "version": "1.0" }
  41. ]
  42. --LOCK--
  43. {
  44. "packages": [
  45. { "name": "vendor/test-package", "version": "1.0" },
  46. { "name": "vendor/not-me", "version": "1.0" },
  47. { "name": "exact/test-package", "version": "1.0" },
  48. { "name": "notexact/testpackage", "version": "1.0" },
  49. { "name": "all/package1", "version": "1.0" },
  50. { "name": "all/package2", "version": "1.0" },
  51. { "name": "another/another", "version": "1.0" },
  52. { "name": "no/regexp", "version": "1.0" }
  53. ],
  54. "packages-dev": [],
  55. "aliases": [],
  56. "minimum-stability": "dev",
  57. "stability-flags": [],
  58. "prefer-stable": false,
  59. "prefer-lowest": false,
  60. "platform": [],
  61. "platform-dev": []
  62. }
  63. --RUN--
  64. update vendor/Test* exact/test-package notexact/Test all/* no/reg.?xp
  65. --EXPECT--
  66. Upgrading all/package1 (1.0 => 2.0)
  67. Upgrading all/package2 (1.0 => 2.0)
  68. Upgrading exact/test-package (1.0 => 2.0)
  69. Upgrading vendor/test-package (1.0 => 2.0)