Skip to content

Commit

Permalink
update readme to describe the each() method
Browse files Browse the repository at this point in the history
  • Loading branch information
FRFlor committed Jun 17, 2024
1 parent 46a9ebd commit 3921018
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ $this->get('/some-route')
});
});
```
If you want to make an assertion against all elements that match the selection, you may use 'each'.

```php
$this->get('/some-route')
->assertElementExists('#overview', function (AssertElement $assert) {
$assert->each('li', function (AssertElement $element) {
$element->has('class', 'list-item');
});
});
```

This means that you can infinitely assert down the dom structure.
```php
Expand Down

0 comments on commit 3921018

Please sign in to comment.