fu::strict_equal(false, $rs, "callback didn't throw correct exception type"); }); fu::test('FUnit::assert_has tests', function () { $arr = array("foo" => true, "bar" => null, "baz" => "bingo"); $obj = new stdClass(); $obj->foo = true; $obj->bar = null; $obj->baz = "bingo"; fu::strict_equal(true, fu::assert_has('foo', $arr)['result'], "\$arr has key 'foo'"); fu::strict_equal(true, fu::assert_has('bar', $arr)['result'], "\$arr has key 'bar'"); fu::strict_equal(true, fu::assert_has('baz', $arr)['result'], "\$arr has key 'baz'"); fu::strict_equal(false, fu::assert_has('bingo', $arr)['result'], "\$arr does not have key 'bingo'"); fu::strict_equal(true, fu::assert_has('foo', $obj)['result'], "\$obj has property 'foo'"); fu::strict_equal(true, fu::assert_has('bar', $obj)['result'], "\$obj has property 'bar'"); fu::strict_equal(true, fu::assert_has('baz', $obj)['result'], "\$obj has property 'baz'"); fu::strict_equal(false, fu::assert_has('bingo', $obj)['result'], "\$obj does not have property 'bingo'"); }); fu::test('FUnit::assert_not_has tests', function () { $arr = array("foo" => true, "bar" => null, "baz" => "bingo"); $obj = new stdClass(); $obj->foo = true; $obj->bar = null; $obj->baz = "bingo"; fu::strict_equal(false, fu::assert_not_has('foo', $arr)['result'], "\$arr has key 'foo'"); fu::strict_equal(false, fu::assert_not_has('bar', $arr)['result'], "\$arr has key 'bar'"); fu::strict_equal(false, fu::assert_not_has('baz', $arr)['result'], "\$arr has key 'baz'"); fu::strict_equal(true, fu::assert_not_has('bingo', $arr)['result'], "\$arr does not have key 'bingo'"); fu::strict_equal(false, fu::assert_not_has('foo', $obj)['result'], "\$obj has property 'foo'"); fu::strict_equal(false, fu::assert_not_has('bar', $obj)['result'], "\$obj has property 'bar'"); fu::strict_equal(false, fu::assert_not_has('baz', $obj)['result'], "\$obj has property 'baz'"); fu::strict_equal(true, fu::assert_not_has('bingo', $obj)['result'], "\$obj does not have property 'bingo'");