File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -916,6 +916,33 @@ public function seeInSession(string $attrib, $value = null)
916
916
}
917
917
}
918
918
919
+ /**
920
+ * Assert that a session attribute does not exist, or is not equal to the passed value.
921
+ *
922
+ * ```php
923
+ * <?php
924
+ * $I->dontSeeInSession('attribute');
925
+ * $I->dontSeeInSession('attribute', 'value');
926
+ * ```
927
+ *
928
+ * @param string $attribute
929
+ * @param mixed|null $value
930
+ * @return void
931
+ */
932
+ public function dontSeeInSession (string $ attribute , $ value = null )
933
+ {
934
+ $ session = $ this ->grabService ('session ' );
935
+
936
+ if (null === $ value ) {
937
+ if ($ session ->has ($ attribute )) {
938
+ $ this ->fail ("Session attribute with name ' $ attribute' does exist " );
939
+ }
940
+ }
941
+ else {
942
+ $ this ->assertNotEquals ($ value , $ session ->get ($ attribute ));
943
+ }
944
+ }
945
+
919
946
/**
920
947
* Opens web page by action name
921
948
*
You can’t perform that action at this time.
0 commit comments