No Description

CHANGES.txt 5.3KB

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