From ba77fc694f8ed1b8e67025cfb4d7a920f408a92e Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Fri, 12 Jul 2024 06:40:40 +0900 Subject: [PATCH] Enable method interception in tests Interface method interception has been enabled in the basic and multiple interceptors tests. This was done by adding a line to turn on method interceptor, ensuring that the test conditions for these methods fully reflect the expected functionality. --- tests/001-rayaop-basic.phpt | 1 + tests/003-rayaop-multiple-interceptors.phpt | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/001-rayaop-basic.phpt b/tests/001-rayaop-basic.phpt index 48848fa..9985ce4 100644 --- a/tests/001-rayaop-basic.phpt +++ b/tests/001-rayaop-basic.phpt @@ -18,6 +18,7 @@ class TestInterceptor implements Ray\Aop\MethodInterceptorInterface { // Register the interceptor $result = method_intercept(TestClass::class, 'testMethod', new TestInterceptor()); +enable_method_intercept(true); var_dump($result); // Call the intercepted method diff --git a/tests/003-rayaop-multiple-interceptors.phpt b/tests/003-rayaop-multiple-interceptors.phpt index 339a480..5cf3539 100644 --- a/tests/003-rayaop-multiple-interceptors.phpt +++ b/tests/003-rayaop-multiple-interceptors.phpt @@ -27,6 +27,7 @@ class Interceptor2 implements Ray\Aop\MethodInterceptorInterface { // Register multiple interceptors method_intercept(TestClass::class, 'testMethod', new Interceptor1()); method_intercept(TestClass::class, 'testMethod', new Interceptor2()); +enable_method_intercept(true); $test = new TestClass(); $result = $test->testMethod("Hello");