Added hasContext to StateEntity.

This commit is contained in:
Abdulmhsen B. A. A.
2024-06-16 14:19:36 +03:00
parent 53d89713bd
commit 3bdd4f2080
3 changed files with 25 additions and 0 deletions

View File

@@ -884,5 +884,13 @@ class StateEntityTest extends TestCase
$entity->getContext(),
'When getContext() is called with no parameters, all context data is returned'
);
$this->assertTrue(
$entity->hasContext('test'),
'When hasContext() is called with existing key, it returns true'
);
$this->assertFalse(
$entity->hasContext('not_set'),
'When hasContext() is called with non-existing key, it returns false'
);
}
}