diff --git a/tests/std/core/001_strcmp.phpt b/tests/std/core/001_strcmp.phpt new file mode 100644 index 00000000..315e927a --- /dev/null +++ b/tests/std/core/001_strcmp.phpt @@ -0,0 +1,41 @@ +--TEST-- +strcmp() / strncmp() / strcasecmp() / strncasecmp() functions +--FILE-- + 0 ? "ok-greater\n" : "fail\n"; +echo strcmp("", "") === 0 ? "ok-empty\n" : "fail\n"; + +echo "strncmp:\n"; +echo strncmp("abcdef", "abcxyz", 3) === 0 ? "ok-equal3\n" : "fail\n"; +echo strncmp("abcdef", "abcxyz", 6) < 0 ? "ok-less6\n" : "fail\n"; +echo strncmp("abc", "abc", 5) === 0 ? "ok-overflow\n" : "fail\n"; + +echo "strcasecmp:\n"; +echo strcasecmp("ABC", "abc") === 0 ? "ok-equal\n" : "fail\n"; +echo strcasecmp("ABC", "abd") < 0 ? "ok-less\n" : "fail\n"; + +echo "strncasecmp:\n"; +echo strncasecmp("ABCDEF", "abcxyz", 3) === 0 ? "ok-equal3\n" : "fail\n"; +echo strncasecmp("ABCDEF", "abcxyz", 6) < 0 ? "ok-less6\n" : "fail\n"; + +?> +--EXPECT-- +strcmp: +ok-equal +ok-less +ok-greater +ok-empty +strncmp: +ok-equal3 +ok-less6 +ok-overflow +strcasecmp: +ok-equal +ok-less +strncasecmp: +ok-equal3 +ok-less6 diff --git a/tests/std/core/002_class_exists.phpt b/tests/std/core/002_class_exists.phpt new file mode 100644 index 00000000..4c4c81c5 --- /dev/null +++ b/tests/std/core/002_class_exists.phpt @@ -0,0 +1,42 @@ +--TEST-- +class_exists() / interface_exists() / trait_exists() / enum_exists() functions +--FILE-- + +--EXPECT-- +class_exists: +ok-true +ok-false +interface_exists: +ok-true +ok-false +trait_exists: +ok-true +ok-false +enum_exists: +ok-true +ok-false +done diff --git a/tests/std/core/003_method_exists.phpt b/tests/std/core/003_method_exists.phpt new file mode 100644 index 00000000..8e7cc7e8 --- /dev/null +++ b/tests/std/core/003_method_exists.phpt @@ -0,0 +1,47 @@ +--TEST-- +method_exists() / property_exists() functions +--FILE-- + +--EXPECT-- +method_exists: +ok-obj-pub +ok-obj-priv +ok-obj-none +ok-cls-pub +ok-cls-none +property_exists: +ok-obj-pub +ok-obj-priv +ok-obj-none +ok-cls-pub +ok-cls-priv +ok-cls-none +done diff --git a/tests/std/core/004_is_a.phpt b/tests/std/core/004_is_a.phpt new file mode 100644 index 00000000..f58c8d8a --- /dev/null +++ b/tests/std/core/004_is_a.phpt @@ -0,0 +1,39 @@ +--TEST-- +is_a() / is_subclass_of() functions +--FILE-- + +--EXPECT-- +is_a: +ok-obj-class +ok-obj-parent +ok-obj-none +is_subclass_of: +ok-obj-parent +ok-obj-same +ok-cls-parent +ok-cls-same +ok-none +done diff --git a/tests/std/core/005_defined.phpt b/tests/std/core/005_defined.phpt new file mode 100644 index 00000000..485b0135 --- /dev/null +++ b/tests/std/core/005_defined.phpt @@ -0,0 +1,23 @@ +--TEST-- +defined() function +--FILE-- + +--EXPECT-- +defined: +ok-defined +ok-string-defined +ok-php-version +ok-undefined +done diff --git a/tests/std/core/006_get_parent_class.phpt b/tests/std/core/006_get_parent_class.phpt new file mode 100644 index 00000000..b5679859 --- /dev/null +++ b/tests/std/core/006_get_parent_class.phpt @@ -0,0 +1,27 @@ +--TEST-- +get_parent_class() function +--FILE-- + +--EXPECT-- +get_parent_class: +ok-obj +ok-cls +ok-obj-false +ok-cls-false +done