1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-07-23 01:31:53 +02:00
Files
php-cimage/features/bootstrap/assert.php
2017-03-03 22:53:29 +01:00

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.");
}
}