diff --git a/hphp/test/ext/test_ext.h b/hphp/test/ext/test_ext.h index be2a19fbb..b3e6690ac 100644 --- a/hphp/test/ext/test_ext.h +++ b/hphp/test/ext/test_ext.h @@ -36,10 +36,6 @@ #include "hphp/facebook/extensions/urlextraction/test_ext_urlextraction.h" #include "hphp/test/ext/test_ext_bcmath.h" #include "hphp/test/ext/test_ext_bzip2.h" -#include "hphp/test/ext/test_ext_class.h" -#include "hphp/test/ext/test_ext_closure.h" -#include "hphp/test/ext/test_ext_collections.h" -#include "hphp/test/ext/test_ext_continuation.h" #include "hphp/test/ext/test_ext_ctype.h" #include "hphp/test/ext/test_ext_curl.h" #include "hphp/test/ext/test_ext_datetime.h" diff --git a/hphp/test/ext/test_ext_class.cpp b/hphp/test/ext/test_ext_class.cpp deleted file mode 100644 index e56564967..000000000 --- a/hphp/test/ext/test_ext_class.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | HipHop for PHP | - +----------------------------------------------------------------------+ - | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ - -#include "hphp/test/ext/test_ext_class.h" -#include "hphp/runtime/ext/ext_class.h" -#include "hphp/runtime/ext/ext_array.h" - -/////////////////////////////////////////////////////////////////////////////// - -bool TestExtClass::RunTests(const std::string &which) { - bool ret = true; - - DECLARE_TEST_FUNCTIONS("class test implements itestable {" - " public $foo;" - " protected $prop;" - " private $bar;" - " public function foo() {}" - " protected function func() {}" - " function bar() {}" - " const const_foo = 'f';" - "}" - "interface itestable {" - " function foo();" - " function bar();" - "}" - ); - - RUN_TEST(test_get_declared_classes); - RUN_TEST(test_get_declared_interfaces); - RUN_TEST(test_class_exists); - RUN_TEST(test_interface_exists); - RUN_TEST(test_get_class_methods); - RUN_TEST(test_get_class_vars); - RUN_TEST(test_get_class_constants); - RUN_TEST(test_get_class); - RUN_TEST(test_get_parent_class); - RUN_TEST(test_is_a); - RUN_TEST(test_is_subclass_of); - RUN_TEST(test_method_exists); - RUN_TEST(test_property_exists); - RUN_TEST(test_get_object_vars); - RUN_TEST(test_call_user_method_array); - RUN_TEST(test_call_user_method); - - return ret; -} - -/////////////////////////////////////////////////////////////////////////////// -// test classes are all in g_class_map defined in test_externals.cpp - -bool TestExtClass::test_get_declared_classes() { - Array classes = f_get_declared_classes(); - VS(f_in_array("test", classes, true), true); - return Count(true); -} - -bool TestExtClass::test_get_declared_interfaces() { - Array classes = f_get_declared_interfaces(); - VS(f_in_array("itestable", classes, true), true); - return Count(true); -} - -bool TestExtClass::test_class_exists() { - VERIFY(f_class_exists("TEst")); - return Count(true); -} - -bool TestExtClass::test_interface_exists() { - VERIFY(f_interface_exists("iTESTable")); - return Count(true); -} - -bool TestExtClass::test_get_class_methods() { - Array methods = f_get_class_methods("TEst"); - VS(methods[0], "foo"); - return Count(true); -} - -bool TestExtClass::test_get_class_vars() { - Array properties = f_get_class_vars("TEst"); - VS(properties, CREATE_MAP1("foo", uninit_null())); - return Count(true); -} - -bool TestExtClass::test_get_class_constants() { - Array constants = f_get_class_constants("test"); - VS(constants, CREATE_MAP1("const_foo", "f")); - return Count(true); -} - -bool TestExtClass::test_get_class() { - // TestCodeRun covers this - return Count(true); -} - -bool TestExtClass::test_get_parent_class() { - // TestCodeRun covers this - return Count(true); -} - -bool TestExtClass::test_is_a() { - // TestCodeRun covers this - return Count(true); -} - -bool TestExtClass::test_is_subclass_of() { - // TestCodeRun covers this - return Count(true); -} - -bool TestExtClass::test_method_exists() { - // TestCodeRun covers this - return Count(true); -} - -bool TestExtClass::test_property_exists() { - VERIFY(f_property_exists("TEst", "prop")); - return Count(true); -} - -bool TestExtClass::test_get_object_vars() { - // TestCodeRun covers this - return Count(true); -} - -bool TestExtClass::test_call_user_method_array() { - // TestCodeRun covers this - return Count(true); -} - -bool TestExtClass::test_call_user_method() { - // TestCodeRun covers this - return Count(true); -} diff --git a/hphp/test/ext/test_ext_class.h b/hphp/test/ext/test_ext_class.h deleted file mode 100644 index f7333b431..000000000 --- a/hphp/test/ext/test_ext_class.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | HipHop for PHP | - +----------------------------------------------------------------------+ - | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ - -#ifndef incl_HPHP_TEST_EXT_CLASS_H_ -#define incl_HPHP_TEST_EXT_CLASS_H_ - -// >>>>>> Generated by idl.php. Do NOT modify. <<<<<< - -#include "hphp/test/ext/test_cpp_ext.h" - -/////////////////////////////////////////////////////////////////////////////// - -class TestExtClass : public TestCppExt { - public: - virtual bool RunTests(const std::string &which); - - bool test_get_declared_classes(); - bool test_get_declared_interfaces(); - bool test_class_exists(); - bool test_interface_exists(); - bool test_get_class_methods(); - bool test_get_class_vars(); - bool test_get_class_constants(); - bool test_get_class(); - bool test_get_parent_class(); - bool test_is_a(); - bool test_is_subclass_of(); - bool test_method_exists(); - bool test_property_exists(); - bool test_get_object_vars(); - bool test_call_user_method_array(); - bool test_call_user_method(); -}; - -/////////////////////////////////////////////////////////////////////////////// - -#endif // incl_HPHP_TEST_EXT_CLASS_H_ diff --git a/hphp/test/ext/test_ext_closure.cpp b/hphp/test/ext/test_ext_closure.cpp deleted file mode 100644 index 78bd2d8dd..000000000 --- a/hphp/test/ext/test_ext_closure.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | HipHop for PHP | - +----------------------------------------------------------------------+ - | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ -#include "hphp/test/ext/test_ext_closure.h" -#include "hphp/runtime/ext/ext_closure.h" - -IMPLEMENT_SEP_EXTENSION_TEST(Closure); -/////////////////////////////////////////////////////////////////////////////// - -bool TestExtClosure::RunTests(const std::string &which) { - bool ret = true; - - RUN_TEST(test_Closure); - - return ret; -} - -/////////////////////////////////////////////////////////////////////////////// - -bool TestExtClosure::test_Closure() { - return Count(true); -} diff --git a/hphp/test/ext/test_ext_closure.h b/hphp/test/ext/test_ext_closure.h deleted file mode 100644 index bcfff4bcc..000000000 --- a/hphp/test/ext/test_ext_closure.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | HipHop for PHP | - +----------------------------------------------------------------------+ - | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ - -#ifndef incl_HPHP_TEST_EXT_CLOSURE_H_ -#define incl_HPHP_TEST_EXT_CLOSURE_H_ - -// >>>>>> Generated by idl.php. Do NOT modify. <<<<<< - -#include "hphp/test/ext/test_cpp_ext.h" - -/////////////////////////////////////////////////////////////////////////////// - -class TestExtClosure : public TestCppExt { - public: - virtual bool RunTests(const std::string &which); - - bool test_Closure(); -}; - -/////////////////////////////////////////////////////////////////////////////// - -#endif // incl_HPHP_TEST_EXT_CLOSURE_H_ diff --git a/hphp/test/ext/test_ext_collections.cpp b/hphp/test/ext/test_ext_collections.cpp deleted file mode 100644 index dc2e4911e..000000000 --- a/hphp/test/ext/test_ext_collections.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | HipHop for PHP | - +----------------------------------------------------------------------+ - | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ - -#include "hphp/test/ext/test_ext_collections.h" -#include "hphp/runtime/ext/ext_collections.h" - -IMPLEMENT_SEP_EXTENSION_TEST(Collection); -/////////////////////////////////////////////////////////////////////////////// - -bool TestExtCollections::RunTests(const std::string &which) { - bool ret = true; - - return ret; -} - -/////////////////////////////////////////////////////////////////////////////// - diff --git a/hphp/test/ext/test_ext_collections.h b/hphp/test/ext/test_ext_collections.h deleted file mode 100644 index 137126ed4..000000000 --- a/hphp/test/ext/test_ext_collections.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | HipHop for PHP | - +----------------------------------------------------------------------+ - | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ - -#ifndef incl_HPHP_TEST_EXT_COLLECTION_H_ -#define incl_HPHP_TEST_EXT_COLLECTION_H_ - -// >>>>>> Generated by idl.php. Do NOT modify. <<<<<< - -#include "hphp/test/ext/test_cpp_ext.h" - -/////////////////////////////////////////////////////////////////////////////// - -class TestExtCollections : public TestCppExt { - public: - virtual bool RunTests(const std::string &which); -}; - -/////////////////////////////////////////////////////////////////////////////// - -#endif // incl_HPHP_TEST_EXT_COLLECTION_H_ diff --git a/hphp/test/ext/test_ext_continuation.cpp b/hphp/test/ext/test_ext_continuation.cpp deleted file mode 100644 index fa89701d2..000000000 --- a/hphp/test/ext/test_ext_continuation.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | HipHop for PHP | - +----------------------------------------------------------------------+ - | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ - -#include "hphp/test/ext/test_ext_continuation.h" -#include "hphp/runtime/ext/ext_continuation.h" - -IMPLEMENT_SEP_EXTENSION_TEST(Continuation); -/////////////////////////////////////////////////////////////////////////////// - -bool TestExtContinuation::RunTests(const std::string &which) { - bool ret = true; - - RUN_TEST(test_BaseContinuation); - RUN_TEST(test_Continuation); - - return ret; -} - -/////////////////////////////////////////////////////////////////////////////// - -bool TestExtContinuation::test_BaseContinuation() { - return Count(true); -} - -bool TestExtContinuation::test_Continuation() { - return Count(true); -} diff --git a/hphp/test/ext/test_ext_continuation.h b/hphp/test/ext/test_ext_continuation.h deleted file mode 100644 index fc2d27748..000000000 --- a/hphp/test/ext/test_ext_continuation.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | HipHop for PHP | - +----------------------------------------------------------------------+ - | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ - -#ifndef incl_HPHP_TEST_EXT_CONTINUATION_H_ -#define incl_HPHP_TEST_EXT_CONTINUATION_H_ - -// >>>>>> Generated by idl.php. Do NOT modify. <<<<<< - -#include "hphp/test/ext/test_cpp_ext.h" - -/////////////////////////////////////////////////////////////////////////////// - -class TestExtContinuation : public TestCppExt { - public: - virtual bool RunTests(const std::string &which); - - bool test_BaseContinuation(); - bool test_Continuation(); -}; - -/////////////////////////////////////////////////////////////////////////////// - -#endif // incl_HPHP_TEST_EXT_CONTINUATION_H_ diff --git a/hphp/test/slow/ext_class/ext_class.php b/hphp/test/slow/ext_class/ext_class.php new file mode 100644 index 000000000..f54fb7269 --- /dev/null +++ b/hphp/test/slow/ext_class/ext_class.php @@ -0,0 +1,31 @@ + null)); + +var_dump(get_class_constants("test") === array("const_foo" => "f")); diff --git a/hphp/test/slow/ext_class/ext_class.php.expect b/hphp/test/slow/ext_class/ext_class.php.expect new file mode 100644 index 000000000..fae4ed595 --- /dev/null +++ b/hphp/test/slow/ext_class/ext_class.php.expect @@ -0,0 +1,7 @@ +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true)