Skip to content

Commit

Permalink
Fix warnings with PHP 8
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Mar 4, 2022
1 parent 6f6bb71 commit 083de94
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Web tests change log

## 7.1.0 / 2022-03-04

* Fixed *urlencode(): Passing null to parameter [...] of type string is
deprecated* warnings in PHP 8
(@thekid)
* Added compatibility with XP 11, newer dependency versions - @thekid

## 7.0.0 / 2020-04-05
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class GitHubTestCase extends WebTestCase {
public function home() {
$this->beginAt('/');
$this->assertStatus(200);
$this->assertTitleEquals('GitHub · Build software better, together.');
$this->assertTitleEquals('GitHub: Where the world builds software · GitHub');
}
}
```
Expand Down
10 changes: 4 additions & 6 deletions src/main/php/unittest/web/Form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
* @see xp://unittest.web.WebTestCase#getForm
*/
class Form {
protected
$test = null,
$node = null,
$fields = null;

protected $test, $node;
protected $fields= null;

/**
* Constructor
*
Expand Down Expand Up @@ -106,7 +104,7 @@ public function toString() {
public function submit() {
$params= '';
foreach ($this->getFields() as $field) {
$params.= '&'.$field->getName().'='.urlencode($field->getValue());
$params.= '&'.$field->getName().'='.urlencode($field->getValue() ?? '');
}
$this->test->navigateTo($this->getAction(), substr($params, 1), $this->getMethod());
}
Expand Down

0 comments on commit 083de94

Please sign in to comment.