Skip to content

Commit e9c5f97

Browse files
committed
tests: fixes for PHP 7.4
1 parent 9e90b4b commit e9c5f97

5 files changed

Lines changed: 9 additions & 7 deletions

tests/Http/SessionSection.basic.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ unset($namespace['a'], $namespace->p, $namespace->o, $namespace->undef);
3939

4040

4141

42-
Assert::same('', http_build_query($namespace->getIterator()));
42+
Assert::same('', http_build_query(iterator_to_array($namespace->getIterator())));

tests/Http/SessionSection.remove.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ $namespace->a = 'apple';
2020
$namespace->p = 'papaya';
2121
$namespace['c'] = 'cherry';
2222

23+
dump($namespace);
24+
2325
$namespace = $session->getSection('three');
24-
Assert::same('a=apple&p=papaya&c=cherry', http_build_query($namespace->getIterator()));
26+
Assert::same('a=apple&p=papaya&c=cherry', http_build_query(iterator_to_array($namespace->getIterator())));
2527

2628

2729
// removing
2830
$namespace->remove();
29-
Assert::same('', http_build_query($namespace->getIterator()));
31+
Assert::same('', http_build_query(iterator_to_array($namespace->getIterator())));

tests/Http/SessionSection.removeExpiration().phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ sleep(3);
2626
$session->start();
2727

2828
$section = $session->getSection('expireRemove');
29-
Assert::same('a=apple&b=banana', http_build_query($section->getIterator()));
29+
Assert::same('a=apple&b=banana', http_build_query(iterator_to_array($section->getIterator())));

tests/Http/SessionSection.setExpiration().phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test(function () use ($session) { // try to expire whole namespace
2929
$session->start();
3030

3131
$namespace = $session->getSection('expire');
32-
Assert::same('', http_build_query($namespace->getIterator()));
32+
Assert::same('', http_build_query(iterator_to_array($namespace->getIterator())));
3333
});
3434

3535

@@ -44,7 +44,7 @@ test(function () use ($session) { // try to expire only 1 of the keys
4444
$session->start();
4545

4646
$namespace = $session->getSection('expireSingle');
47-
Assert::same('p=plum', http_build_query($namespace->getIterator()));
47+
Assert::same('p=plum', http_build_query(iterator_to_array($namespace->getIterator())));
4848
});
4949

5050

tests/Http/SessionSection.undefined.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ $session = new Session(new Nette\Http\Request(new Nette\Http\UrlScript), new Net
1818
$namespace = $session->getSection('one');
1919
Assert::false(isset($namespace->undefined));
2020
Assert::null($namespace->undefined); // Getting value of non-existent key
21-
Assert::same('', http_build_query($namespace->getIterator()));
21+
Assert::same('', http_build_query(iterator_to_array($namespace->getIterator())));

0 commit comments

Comments
 (0)