update-whitelist-patterns.test 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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/NotMe", "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/NotMe": "*.*",
  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/NotMe", "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. --RUN--
  43. update vendor/Test* exact/Test-Package notexact/Test all/* no/reg?xp
  44. --EXPECT--
  45. Updating vendor/Test-Package (1.0) to vendor/Test-Package (2.0)
  46. Updating exact/Test-Package (1.0) to exact/Test-Package (2.0)
  47. Updating all/Package1 (1.0) to all/Package1 (2.0)
  48. Updating all/Package2 (1.0) to all/Package2 (2.0)