Skip to content

Commit 620daba

Browse files
authored
Added seeSessionHasValues function (#73)
1 parent 33aa68c commit 620daba

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/Codeception/Module/Symfony.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,29 @@ public function logout()
890890
$cookieJar->flushExpiredCookies();
891891
}
892892

893+
/**
894+
* Assert that the session has a given list of values.
895+
*
896+
* ``` php
897+
* <?php
898+
* $I->seeSessionHasValues(['key1', 'key2']);
899+
* $I->seeSessionHasValues(['key1' => 'value1', 'key2' => 'value2']);
900+
* ```
901+
*
902+
* @param array $bindings
903+
* @return void
904+
*/
905+
public function seeSessionHasValues(array $bindings)
906+
{
907+
foreach ($bindings as $key => $value) {
908+
if (is_int($key)) {
909+
$this->seeInSession($value);
910+
} else {
911+
$this->seeInSession($key, $value);
912+
}
913+
}
914+
}
915+
893916
/**
894917
* Assert that a session attribute exists.
895918
*

0 commit comments

Comments
 (0)