CHANGES.txt 5.2 KB

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