Changeset 59398
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/interactivity-api/class-wp-interactivity-api.php
r59153 r59398 585 585 $current = $current->$path_segment; 586 586 } else { 587 return null; 587 $current = null; 588 break; 588 589 } 589 590 -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php
r59131 r59398 1081 1081 1082 1082 /** 1083 * Tests that the `evaluate` method operates correctly when used with the 1084 * negation operator (!) with non-existent paths. 1085 * 1086 * @ticket 62374 1087 * 1088 * @covers ::evaluate 1089 */ 1090 public function test_evaluate_value_negation_non_existent_path() { 1091 $this->interactivity->state( 'myPlugin', array() ); 1092 $this->interactivity->state( 'otherPlugin', array() ); 1093 $this->set_internal_context_stack( 1094 array( 1095 'myPlugin' => array(), 1096 'otherPlugin' => array(), 1097 ) 1098 ); 1099 $this->set_internal_namespace_stack( 'myPlugin' ); 1100 1101 $result = $this->evaluate( '!state.missing' ); 1102 $this->assertTrue( $result ); 1103 1104 $result = $this->evaluate( '!context.missing' ); 1105 $this->assertTrue( $result ); 1106 1107 $result = $this->evaluate( 'otherPlugin::!state.deeply.nested.missing' ); 1108 $this->assertTrue( $result ); 1109 1110 $result = $this->evaluate( 'otherPlugin::!context.deeply.nested.missing' ); 1111 $this->assertTrue( $result ); 1112 } 1113 1114 /** 1083 1115 * Tests the `evaluate` method with non-existent paths. 1084 1116 *
Note: See TracChangeset
for help on using the changeset viewer.