mirror of
https://github.com/mosbth/cimage.git
synced 2025-07-23 01:31:53 +02:00
33 lines
643 B
PHP
33 lines
643 B
PHP
<?php
|
|
/**
|
|
* Assert functions.
|
|
*/
|
|
function assertNotEquals($expected, $actual)
|
|
{
|
|
if (!($expected !== $actual)) {
|
|
throw new Exception("Failed asserting that '$expected' is not equal to '$actual'.");
|
|
}
|
|
};
|
|
|
|
|
|
|
|
function assertEquals($expected, $actual)
|
|
{
|
|
if (!($expected === $actual)) {
|
|
throw new Exception("Failed asserting that '$expected' is equal to '$actual'.");
|
|
}
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
* Check that $needle is an element of $haystack.
|
|
*/
|
|
|
|
function assertContains($needle, $haystack)
|
|
{
|
|
if (!in_array($needle, $haystack)) {
|
|
throw new Exception("Failed asserting that '$needle' is not in haystack.");
|
|
}
|
|
}
|