function calculateAge($yearOfBirth) { expectsToBe($yearOfBirth, 'to be an integer > 1900 and <= current year', function ($arg) { return is_int($arg) && $arg > 1900 && $arg <= (int) date('Y'); }); return (int) date('Y') - $yearOfBirth; }
function expectsCustomNegativeTest($arg1) { expectsToBe($arg1, 'a positive integer', function ($arg) { return is_int($arg) && $arg > 0; }); }