|
@@ 521-528 (lines=8) @@
|
| 518 |
|
* @param string $value |
| 519 |
|
* @param string $regex |
| 520 |
|
*/ |
| 521 |
|
public function assert_pattern($value, $regex, $debug = null) |
| 522 |
|
{ |
| 523 |
|
if (! is_string($value) or ! is_string($regex) or ! preg_match($regex, $value)) { |
| 524 |
|
throw new Kohana_Unit_Test_Exception(Kohana::lang('unit_test.assert_pattern', var_export($value, true), var_export($regex, true)), $debug); |
| 525 |
|
} |
| 526 |
|
|
| 527 |
|
return $this; |
| 528 |
|
} |
| 529 |
|
|
| 530 |
|
/** |
| 531 |
|
* @param string $value |
|
@@ 534-541 (lines=8) @@
|
| 531 |
|
* @param string $value |
| 532 |
|
* @param string $regex |
| 533 |
|
*/ |
| 534 |
|
public function assert_not_pattern($value, $regex, $debug = null) |
| 535 |
|
{ |
| 536 |
|
if (! is_string($value) or ! is_string($regex) or preg_match($regex, $value)) { |
| 537 |
|
throw new Kohana_Unit_Test_Exception(Kohana::lang('unit_test.assert_not_pattern', var_export($value, true), var_export($regex, true)), $debug); |
| 538 |
|
} |
| 539 |
|
|
| 540 |
|
return $this; |
| 541 |
|
} |
| 542 |
|
} // End Unit_Test_Case |
| 543 |
|
|
| 544 |
|
|