From 4194e0415b02827b0d5eeff13771eb6642955b0f Mon Sep 17 00:00:00 2001 From: Fabien Villepinte Date: Mon, 21 Oct 2019 21:17:16 +0200 Subject: [PATCH] Add tests for ReflectionZendExtension --- .../tests/ReflectionZendExtension_basic1.phpt | 25 ++++++++++++++ .../ReflectionZendExtension_error001.phpt | 12 +++++++ .../ReflectionZendExtension_toString.phpt | 33 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 ext/reflection/tests/ReflectionZendExtension_basic1.phpt create mode 100644 ext/reflection/tests/ReflectionZendExtension_error001.phpt create mode 100644 ext/reflection/tests/ReflectionZendExtension_toString.phpt diff --git a/ext/reflection/tests/ReflectionZendExtension_basic1.phpt b/ext/reflection/tests/ReflectionZendExtension_basic1.phpt new file mode 100644 index 0000000000..ee89002a1d --- /dev/null +++ b/ext/reflection/tests/ReflectionZendExtension_basic1.phpt @@ -0,0 +1,25 @@ +--TEST-- +ReflectionZendExtension: basic tests for accessors +--SKIPIF-- + +--FILE-- +getName()); +var_dump($rze->getVersion() === PHP_VERSION); +var_dump($rze->getAuthor()); +var_dump($rze->getURL()); +var_dump($rze->getCopyright()); +?> +--EXPECT-- +string(12) "Zend OPcache" +bool(true) +string(17) "Zend Technologies" +string(20) "http://www.zend.com/" +string(13) "Copyright (c)" diff --git a/ext/reflection/tests/ReflectionZendExtension_error001.phpt b/ext/reflection/tests/ReflectionZendExtension_error001.phpt new file mode 100644 index 0000000000..2e5b44be6c --- /dev/null +++ b/ext/reflection/tests/ReflectionZendExtension_error001.phpt @@ -0,0 +1,12 @@ +--TEST-- +ReflectionZendExtension: error with invalid extension name +--FILE-- +getMessage(); +} +?> +--EXPECT-- +Zend Extension foo-bar-baz does not exist diff --git a/ext/reflection/tests/ReflectionZendExtension_toString.phpt b/ext/reflection/tests/ReflectionZendExtension_toString.phpt new file mode 100644 index 0000000000..4db8cce879 --- /dev/null +++ b/ext/reflection/tests/ReflectionZendExtension_toString.phpt @@ -0,0 +1,33 @@ +--TEST-- +ReflectionZendExtension: basic test for __toString() +--SKIPIF-- + +--FILE-- +{$method}(); + if (strpos($str, $prop) === false) { + echo "The result of $method() ($prop) is not found in: $str\n"; + } +} +?> +===DONE=== +--EXPECT-- +===DONE=== -- 2.40.0