Skip to content

Commit

Permalink
Enable method interception in tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
koriym committed Jul 11, 2024
1 parent 10b183e commit ba77fc6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/001-rayaop-basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/003-rayaop-multiple-interceptors.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit ba77fc6

Please sign in to comment.