/** * Checks if the string contains any of the provided needles. * * @param array(string|Mol_DataType_String) $needles * @return boolean True if the string contains a needle, false otherwise. */ public function containsAny(array $needles) { $needles = $this->toValues($needles); return Mol_Util_String::containsAny($this->value, $needles); }
/** * Ensures that containsAny() returns true if an empty list of needles is provided. */ public function testContainsAnyReturnsTrueIfListOfNeedlesIsEmpty() { $result = Mol_Util_String::containsAny('abc', array()); $this->assertTrue($result); }