CHANGES.txt 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. == Version 2.1.1: Released Apr 30 2025 ==
  2. * Fix implicitly nullable via default value null for PHP 8.4 (#85)
  3. == Version 2.1.0: Released Apr 29 2025 ==
  4. * Dropped support for PHP <=7.3
  5. == Version 2.0.1: Released Jul 09 2020 ==
  6. * Added support for PHP 8
  7. == Version 2.0: Released Feb 26 2016 ==
  8. * Removed automatic loading of global functions
  9. == Version 1.1.0: Released Feb 2 2012 ==
  10. Issues Fixed: 121, 138, 147
  11. * Added non-empty matchers to complement the emptiness-matching forms.
  12. - nonEmptyString()
  13. - nonEmptyArray()
  14. - nonEmptyTraversable()
  15. * Added ability to pass variable arguments to several array-based matcher
  16. factory methods so they work like allOf() et al.
  17. - anArray()
  18. - arrayContainingInAnyOrder(), containsInAnyOrder()
  19. - arrayContaining(), contains()
  20. - stringContainsInOrder()
  21. * Matchers that accept an array of matchers now also accept variable arguments.
  22. Any non-matcher arguments are wrapped by IsEqual.
  23. * Added noneOf() as a shortcut for not(anyOf()).
  24. == Version 1.0.0: Released Jan 20 2012 ==
  25. Issues Fixed: 119, 136, 139, 141, 148, 149, 172
  26. * Moved hamcrest.php into Hamcrest folder and renamed to Hamcrest.php.
  27. This is more in line with PEAR packaging standards.
  28. * Renamed callable() to callableValue() for compatibility with PHP 5.4.
  29. * Added Hamcrest_Text_StringContainsIgnoringCase to assert using stripos().
  30. assertThat('fOObAr', containsStringIgnoringCase('oba'));
  31. assertThat('fOObAr', containsString('oba')->ignoringCase());
  32. * Fixed Hamcrest_Core_IsInstanceOf to return false for native types.
  33. * Moved string-based matchers to Hamcrest_Text package.
  34. StringContains, StringEndsWith, StringStartsWith, and SubstringMatcher
  35. * Hamcrest.php and Hamcrest_Matchers.php are now built from @factory doctags.
  36. Added @factory doctag to every static factory method.
  37. * Hamcrest_Matchers and Hamcrest.php now import each matcher as-needed
  38. and Hamcrest.php calls the matchers directly instead of Hamcrest_Matchers.
  39. == Version 0.3.0: Released Jul 26 2010 ==
  40. * Added running count to Hamcrest_MatcherAssert with methods to get and reset it.
  41. This can be used by unit testing frameworks for reporting.
  42. * Added Hamcrest_Core_HasToString to assert return value of toString() or __toString().
  43. assertThat($anObject, hasToString('foo'));
  44. * Added Hamcrest_Type_IsScalar to assert is_scalar().
  45. Matches values of type bool, int, float, double, and string.
  46. assertThat($count, scalarValue());
  47. assertThat('foo', scalarValue());
  48. * Added Hamcrest_Collection package.
  49. - IsEmptyTraversable
  50. - IsTraversableWithSize
  51. assertThat($iterator, emptyTraversable());
  52. assertThat($iterator, traversableWithSize(5));
  53. * Added Hamcrest_Xml_HasXPath to assert XPath expressions or the content of nodes in an XML/HTML DOM.
  54. assertThat($dom, hasXPath('books/book/title'));
  55. assertThat($dom, hasXPath('books/book[contains(title, "Alice")]', 3));
  56. assertThat($dom, hasXPath('books/book/title', 'Alice in Wonderland'));
  57. assertThat($dom, hasXPath('count(books/book)', greaterThan(10)));
  58. * Added aliases to match the Java API.
  59. hasEntry() -> hasKeyValuePair()
  60. hasValue() -> hasItemInArray()
  61. contains() -> arrayContaining()
  62. containsInAnyOrder() -> arrayContainingInAnyOrder()
  63. * Added optional subtype to Hamcrest_TypeSafeMatcher to enforce object class or resource type.
  64. * Hamcrest_TypeSafeDiagnosingMatcher now extends Hamcrest_TypeSafeMatcher.
  65. == Version 0.2.0: Released Jul 14 2010 ==
  66. Issues Fixed: 109, 111, 114, 115
  67. * Description::appendValues() and appendValueList() accept Iterator and IteratorAggregate. [111]
  68. BaseDescription::appendValue() handles IteratorAggregate.
  69. * assertThat() accepts a single boolean parameter and
  70. wraps any non-Matcher third parameter with equalTo().
  71. * Removed null return value from assertThat(). [114]
  72. * Fixed wrong variable name in contains(). [109]
  73. * Added Hamcrest_Core_IsSet to assert isset().
  74. assertThat(array('foo' => 'bar'), set('foo'));
  75. assertThat(array('foo' => 'bar'), notSet('bar'));
  76. * Added Hamcrest_Core_IsTypeOf to assert built-in types with gettype(). [115]
  77. Types: array, boolean, double, integer, null, object, resource, and string.
  78. Note that gettype() returns "double" for float values.
  79. assertThat($count, typeOf('integer'));
  80. assertThat(3.14159, typeOf('double'));
  81. assertThat(array('foo', 'bar'), typeOf('array'));
  82. assertThat(new stdClass(), typeOf('object'));
  83. * Added type-specific matchers in new Hamcrest_Type package.
  84. - IsArray
  85. - IsBoolean
  86. - IsDouble (includes float values)
  87. - IsInteger
  88. - IsObject
  89. - IsResource
  90. - IsString
  91. assertThat($count, integerValue());
  92. assertThat(3.14159, floatValue());
  93. assertThat('foo', stringValue());
  94. * Added Hamcrest_Type_IsNumeric to assert is_numeric().
  95. Matches values of type int and float/double or strings that are formatted as numbers.
  96. assertThat(5, numericValue());
  97. assertThat('-5e+3', numericValue());
  98. * Added Hamcrest_Type_IsCallable to assert is_callable().
  99. assertThat('preg_match', callable());
  100. assertThat(array('SomeClass', 'SomeMethod'), callable());
  101. assertThat(array($object, 'SomeMethod'), callable());
  102. assertThat($object, callable());
  103. assertThat(function ($x, $y) { return $x + $y; }, callable());
  104. * Added Hamcrest_Text_MatchesPattern for regex matching with preg_match().
  105. assertThat('foobar', matchesPattern('/o+b/'));
  106. * Added aliases:
  107. - atLeast() for greaterThanOrEqualTo()
  108. - atMost() for lessThanOrEqualTo()
  109. == Version 0.1.0: Released Jul 7 2010 ==
  110. * Created PEAR package
  111. * Core matchers