Changeset 58320
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/interactivity-api/class-wp-interactivity-api.php
r58159 r58320 424 424 $current = $store; 425 425 foreach ( $path_segments as $path_segment ) { 426 if ( isset( $current[ $path_segment ] ) ) {426 if ( isset( $current[ $path_segment ] ) ) { 427 427 $current = $current[ $path_segment ]; 428 429 428 430 } else { 429 431 return null; -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php
r58159 r58320 817 817 private function evaluate( $directive_value ) { 818 818 $generate_state = function ( $name ) { 819 820 819 821 return array( 820 'key' => $name, 821 'nested' => array( 'key' => $name . '-nested' ), 822 'key' => $name, 823 'nested' => array( 'key' => $name . '-nested' ), 824 'obj' => $obj, 825 'arrAccess' => new class() implements ArrayAccess { 826 #[\ReturnTypeWillChange] 827 public function offsetExists( $offset ) { 828 return true; 829 } 830 831 public function offsetGet( $offset ): string { 832 return $offset; 833 } 834 835 public function offsetSet( $offset, $value ): void {} 836 837 public function offsetUnset( $offset ): void {} 838 }, 822 839 ); 823 840 }; … … 827 844 'myPlugin' => $generate_state( 'myPlugin-context' ), 828 845 'otherPlugin' => $generate_state( 'otherPlugin-context' ), 846 829 847 ); 830 848 $evaluate = new ReflectionMethod( $this->interactivity, 'evaluate' ); … … 852 870 $result = $this->evaluate( 'otherPlugin::context.key' ); 853 871 $this->assertEquals( 'otherPlugin-context', $result ); 872 873 874 875 876 877 854 878 } 855 879
Note: See TracChangeset
for help on using the changeset viewer.