CHANGES.txt 5.1 KB

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