Exemple #1
0
/**
 * This is useful for fluently combining matchers that must both pass.
 * For example:
 * <pre>
 *   assertThat($string, both(containsString("a"))->andAlso(containsString("b")));
 * </pre>
 */
function both(Hamcrest_Matcher $matcher)
{
    require_once 'Hamcrest/Core/CombinableMatcher.php';
    return Hamcrest_Core_CombinableMatcher::both($matcher);
}
 public function setUp()
 {
     $this->_either_3_or_4 = Hamcrest_Core_CombinableMatcher::either(equalTo(3))->orElse(equalTo(4));
     $this->_not_3_and_not_4 = Hamcrest_Core_CombinableMatcher::both(not(equalTo(3)))->andAlso(not(equalTo(4)));
 }